Skip to content
Tcl Source Code Artifact [da547bc96a]
Login

Artifact [da547bc96a]

Artifact da547bc96ada9dcc7fcb9ae80d7df55101715d0ed81ccd8458ef201d9f6e96bc:

Ticket change [da547bc96a] - Ticket [1e48483c8b3b2702|1e48483c8b] <i>Use of non-standard C code in TCLBOOLWARNING</i> status still Open with 3 other changes by gustafn3 on 2024-05-01 10:19:46.
D 2024-05-01T10:19:46.897
J icomment With\sthe\sfollowing\sversion\sof\sthe\smacro,\sit\scompiles\sclean\swith\sand\swithout\s-std=c99\sunder\sLinux\s(tested\swith\sgcc\sversion\s12.2.0)\sand\smacOS\s(tested\swith\sstandard\sApple\scompiler\sclang-1500.3.9.4\sand\sclang\s17.0.6)\r\n\r\n#if\s!defined(__cplusplus)\s&&\s!defined(BUILD_tcl)\s&&\s!defined(BUILD_tk)\s&&\sdefined(__STDC_VERSION__)\s&&\s(__STDC_VERSION__\s>=\s201112L)\r\n#\s\s\s\s\s\s\sdefine\sTCLBOOLWARNING(boolPtr)\s(void)(sizeof(struct\s{_Static_assert(sizeof(*(boolPtr))\s<=\ssizeof(int),\s"sizeof(boolPtr)\stoo\slarge");int\sdummy;})),\r\n#elif\sdefined(__GNUC__)\s&&\sdefined(__STDC_VERSION__)\s&&\s(__STDC_VERSION__\s>=\s201112L)\r\n\s\s\s\s\s\s\s\s/*\sIf\sthis\sgives:\s"error:\ssize\sof\sarray\s‘_bool_Var’\sis\snegative",\sit\smeans\sthat\ssizeof(*boolPtr)>sizeof(int),\swhich\sis\snot\sallowed\s*/\r\n#\s\s\sdefine\sTCLBOOLWARNING(boolPtr)\s({__attribute__((unused))\schar\s_bool_Var[sizeof(*(boolPtr))\s>\ssizeof(int)\s?\s-1\s:\s1];}),\r\n#else\r\n#\s\s\sdefine\sTCLBOOLWARNING(boolPtr)\r\n#endif
J login gustafn3
J mimetype text/plain
K 1e48483c8b3b2702b981ebcc85474512bb3d6e0d
U gustafn3
Z 029b4778b5319854c70db26f8ee65556