Skip to content
Tcl Source Code Artifact [5736ad6a79]
Login

Artifact [5736ad6a79]

Artifact 5736ad6a79c8fb3ea138fdde3e719f5f4955f263:

Ticket change [5736ad6a79] - Ticket [509340ffffffffff|509340ffff] <i>ClientData set to int* not void* </i> status still Open with 4 other changes by nobody on 2002-05-28 19:39:22.
D 2002-05-28T19:39:22
J icomment Logged\sIn:\sNO\s\n\nCurrently\sClientData\sis\sdefined\sas\sfollows\s(from\stcl.h)\n#\s\s\sif\sdefined(__STDC__)\s||\sdefined(__cplusplus)\n\s\s\s\stypedef\svoid\s*ClientData;\n#\s\s\selse\n\s\s\s\stypedef\sint\s*ClientData;\n#\s\s\sendif\s/*\s__STDC__\s*/\s\nWith\sthe\sBorland\scompiler\s(and\sapparently\swith\sVC++,\stoo)\nthis\swill\sresult\sin"\stypedef\sint\s*ClientData",\sleading\sto\sa\nlot\sof\sotherwise\sunnecessary\stypecasts.\n\nExplanation:\nFor\sthe\sBorland\scompiler\s__STDC__\smeans\s*strict*\scompliance\nto\sANSI\sC\s(you\scan\sset\sthis\smode\swith\sthe\s-A\sflag).\sWith\nthis\sflag\sturned\son,\showever,\sTcl\swon't\scompile\s-\ssome\nWindows\sheader\sfiles\scontaining\sC++\sstyle\s(//)\scomments.\sI\ntend\sto\sthink\sthat\sthis\sis\sa\ssensible\sthing\sto\sdo\s(you\swant\nANSI\sC,\syou\sget\s-\sstrict\s-\sANSI\sC),\sbut\sthis\sis\sjust\sopinion\n-\swe\sgot\sa\sproblem\sto\ssolve.\n\nThe\scriterion\sused\sabove\n\s\s\s\s#\s\s\sif\sdefined(__STDC__)\s||\sdefined(__cplusplus)\nassumes\sthis\sscenario:\n-\spre-ANSI\sC\n-\sANSI\sC\sor\n-\sC++\n\nHowever\sthis\sdoes\snot\sdescribe\sthe\sactual\ssituation,\swhere\nwe\shave\ssort\sof\sa\spost-ANSI\speriod:\sC\scompilers\sadhering\sto\nthe\sstandard\sbut\sallowing\sextensions,\stoo\s(like\sC++\ncomments).\s(And\sdiffering\sof\scourse\sin\swhether\sthey\s#define\n__STDC__\sfor\sthese\sextensions\sor\snot.).\nI\swould\stherefore\ssuggest\sthat\swe\schange\sthe\scriterion.\nAfter\sall,\sall\swe\swant\sto\sknow\sis\swhether\sthe\scompiler\sknows\nthe\s'void'\skey\sword.\sWe\sdon't\sreally\scare\s(at\sthis\spoint)\nwhether\sits\sinternal\slogic\sdefines\s__STDC__.\sSo\smy\nsuggestion\sis\sto\sadd\sa\s\n\s\s\s#define\sKNOSW_VOID\nand\suse\sthis\sfor\sthe\stypedef\sof\sClientData\n\n#\s\s\sifdef\sKNOWS_VOID\n\s\s\s\stypedef\svoid\s*ClientData;\n#\s\s\selse\n\s\s\s\stypedef\sint\s*ClientData;\n\s#\s\s\sendif\s/*\sKNOWS_VOID\s*/\n\nI\sassume\sthat\sall\scurrent\scompilers\ssupport\s'void',\sso\swe\nprobably\sdon't\seven\sneed\sthis\scheck.\sIf,\showever,\sit\sturns\nout\sthat\sthere\sis\sa\scompiler\swhich\sbarks\son\s'void',\swe\scould\nadd\sstuff\sto\shandle\sjust\sthis\scompiler.\n\n#define\sKNOWS_VOID\n\n#if\sdefined\sSomeWeirdCompiler\n#undef\sKNOWS_VOID\n#endif\nIn\sany\scase,\swe\sshould\schange\sthe\scriterion\sin\ssome\sway,\nbecause\sit\sdoesn't\shandle\sthe\sactual\ssituation.\n\nJust\smy\s0.02\nHelmut\sGiese\n
J login nobody
J mimetype text/plain
J username nobody
K 509340ffffffffffffffffffffffffffffffffff
U nobody
Z 9ef08695a91fe6e00908dc374fcb7a44