Compiler bug

Stephen J. Friedl friedl at vsi.COM
Wed Dec 21 17:44:47 AEST 1988


Somebody posts this code that fails one a 4BSD VAX:

> int foo = 1 && 0;       /* "foo.c", line 1: illegal initialization */

In article <126 at mole-end.UUCP>, mat at mole-end.UUCP (Mark A Terribile) writes:
> According to the reference manual in the back of K&R (I haven't yet got
> the dpANS for C) && and || are NOT among the operators which may be used
> to compose constant expressions, [...]

The dpANS [May88] says this is OK.  Look in the Language Syntax Summary
in Appendix A and focus on `initializer' (bottom of p 180).  Follow it up
the path and you'll hit || and &&.  I didn't see any constraints that
would prevent this, and my compiler takes it as well.

     Steve

-- 
Stephen J. Friedl        3B2-kind-of-guy            friedl at vsi.com
V-Systems, Inc.                                 attmail!vsi!friedl
Santa Ana, CA  USA       +1 714 545 6442    {backbones}!vsi!friedl
Nancy Reagan on my new '89 Mustang GT Convertible: "Just say WOW!"



More information about the Comp.lang.c mailing list