Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Is it only ANSI C that allow #if to compare symbols? Keywords: sun C #if Message-ID: <14916@smoke.brl.mil> Date: 21 Jan 91 21:12:50 GMT References: <1991Jan18.170921.4866@resam.dk> <14900@smoke.brl.mil> <1991Jan21.090551.12909@resam.dk> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 16 In article <1991Jan21.090551.12909@resam.dk> andrew@resam.dk (Leif Andrew Rump) writes: -The (Danish version of the) Ansi K&R compiler gives the following example: [I assume you mean that some manual for some compiler gives the example.] -#define SYSTEM SPARC -#if SYSTEM == SPARC - ... -#else - ... -#endif -I was not able to find the book this morning but i _don't_ remember any -defines giving the symbol SPARC any numerical value. If not, then the example is incorrect. (Well, actually it would work due to the expression being evaluated as 0==0, but SYSTEM cannot be used to select among different system types in this way unless each system-type macro is given a distinct value.)