Compiler bug
Niels J|rgen Kruse
njk at freja.diku.dk
Thu Dec 15 07:29:09 AEST 1988
Consider this little one liner:
-------- foo.c --------
int foo = 1 && 0;
------ end foo.c ------
On a Bsd 4.3 VAX 785, cc complains :
"foo.c", line 1: illegal initialization
and likewise does lint :
foo.c:
foo.c(1): illegal initialization
foo defined( foo.c(1) ), but never used
On a Xenix286 intel sys310, cc compiles it nicely, but lint
complains :
foo.c
==============
(1) warning: constant in conditional context
(1) illegal initialization
==============
name defined but never used
foo foo.c(1)
So 3 out of 4 get it wrong. This bug seems to bee contagious.
-----
Niels J|rgen Kruse
njk at freja.dk
DIKU, Copenhagen, Denmark
More information about the Comp.lang.c
mailing list