Path: utzoo!attcan!uunet!vsi!friedl From: friedl@vsi.COM (Stephen J. Friedl) Newsgroups: comp.lang.c Subject: Re: Compiler bug Summary: && in initializers is allowed in ANSI C Message-ID: <974@vsi.COM> Date: 21 Dec 88 07:44:47 GMT References: <4279@freja.diku.dk> <126@mole-end.UUCP> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 21 Somebody posts this code that fails one a 4BSD VAX: > int foo = 1 && 0; /* "foo.c", line 1: illegal initialization */ In article <126@mole-end.UUCP>, mat@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@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!"