Auto variable with sizeof == 0
tanner at ki4pv.UUCP
tanner at ki4pv.UUCP
Fri Feb 13 03:36:03 AEST 1987
) braner at batcomputer.tn.cornell.edu (braner) writes
) ... char text[] ...
) ... Question: Do some compilers refuse to accept this?
Yes, the microsoft compiler (at least the one distributed by SCO as
2.2\(*b) refuses to accept this. Says "unknown size", of all things.
I can understand and sympathise with this, of course -- the size is
not specified, so I'd consider it unknown too.
However, note that the obvious replacement (char text[0]) elicits the
same error message, even though the size IS known (to be zero).
In all fairness, this is a beta release of the compiler, and it may have
been fixed already.
--
<std dsclm, copies upon request> Tanner Andrews
More information about the Comp.lang.c
mailing list