Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!ucsfcgl!cca.ucsf.edu!root From: root@cca.ucsf.edu (Computer Center) Newsgroups: comp.sys.atari.st Subject: Re: Laser C bug Message-ID: <1198@ucsfcca.ucsf.edu> Date: 18 Mar 88 02:22:43 GMT References: <4057@batcomputer.tn.cornell.edu> Organization: Computer Center, UCSF Lines: 27 Summary: K & R excludes && and || In article <4057@batcomputer.tn.cornell.edu>, braner@batcomputer.tn.cornell.edu (braner) writes: > > The Laser C preprocessor will not take a logical OR, as in: > > #if (AtST || MSDOS) /* does not work! */ > > I consider this a bug since in "C: A Reference Manual" by Harbison & Steele > (highly recommended, look for 2nd edition!) it says explicitly that "||" > is OK in the constant expression for #if. > Sorry, Moshe, Harbison & Steele may be a fine book but it is not a standard document. Short of the ANSI standard getting final approval the only real C standards are K & R and the extensions in the AT&T Unix release compilers (and these certainly rank below K & R). OK, see K & R, p. 211 for the definition of `constant expressions' which are required by the preprocessor definition (p. 208). The list of allowed operators does _not_ include the logical operators && and ||. Thos Thos Sumner (thos@cca.ucsf.edu) BITNET: thos@ucsfcca (The I.G.) (...ucbvax!ucsfcgl!cca.ucsf!thos) OS|2 -- an Operating System for puppets. #include