🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #31328

Re: Laser C bug

#31328
From: Computer Center
Date: Fri, 18 Mar 1988 02:22
28 lines
1498 bytes
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 <disclaimer.std>
Technical Details
Message-ID: <1198@ucsfcca.ucsf.edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!ucsfcgl!cca.ucsf.edu!root
References: <4057@batcomputer.tn.cornell.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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 ||