comp.lang.c
[Top] [All Lists]

Re: void * vs. T *

Subject: Re: void * vs. T *
From: Ark Khasin
Date: Fri, 28 Mar 2008 16:10:15 GMT
Newsgroups: comp.lang.c


Eric Sosman wrote:
I mean a use of compile-time assert, like
extern int foo[(e)?1:-1];
e being the expression above. It's not for an #if.

    For a compile-time "assert" you still need a constant
expression.  In C90 you can't use a non-constant as an
array dimension at all.  You can in C99 (in some contexts),
but then you get a variable-length array and undefined
behavior -- at run time, not compile time.

Please note that it's constant (1) or invalid (-1).


<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy