Hi, TCCers!
(This is my first post to the list.)
Every now and then i write code like the following:
static const size_t sz = 1024 * 2;
char buffer[sz];
...
tcc complains that sz is not a constant expression, which "just doesn't seem
right" to me. It does of course accept:
enum { sz = 1024 * 2 };
char buffer[sz];
but i'm quite pedantic about type safety, and hate having to cast my enum
values to size_t (or whatever) during later calls which use the "sz" value.
Is there a particular reason which tcc (0.9.25) doesn't recognize static
consts as const values? i understand that tcc doesn't support C99 vararrays,
but a static const isn't quite the same as using, e.g., a value passed to
the function as the array size. (Or maybe they are the same, from tcc's
point of view?) This behaviour has been, in recent months, the only place i
have to retroactively change code to make it work in tcc.
:-?
PS: tcc's speed amazes me every time i use it. See the second gray box at:
http://fossil.wanderinghorse.net/repos/whio/index.cgi/wiki/AmalgamationBuild
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel