In message <[EMAIL PROTECTED]>, Tom Tromey writes:
>Olly> Dear me.  Actually, BCPL's truth value is -1, so I can believe early
>Olly> versions of C might behave the same way.
>
>It seems unlikely that this is important.

I tend to agree, but there's an equally tidy solution which avoids the
issue.  It's since occured to me you can also invert the condition and
let it clash with "0" (since any C compiler which uses something other
than zero for false will fail to compile most programs correctly):

  switch (0) case 0: case (sizeof(long double) >= sizeof(double)):;

>Olly> I'm unsure how `int a[0];' will be handled by various compilers.
>
>gcc accepts this as an extension.
>It is useful when using the "struct hack", at least.

Ah yes, of course.  Not a great justification though, since an array
size of one gives a much more portable struct hack (albeit slightly
uglier).

Cheers,
Olly

Reply via email to