Standardization questions (cpp mostl

Dick Dunn rcd at opus.UUCP
Fri Oct 12 05:14:27 AEST 1984


>...
> >   1.   undefined token has the value zero (in #if's).  Cpp should
> >        print a warning -- or error if the evaluator is intelligent
> >        about statements like:
> >                #if defined (foo) && foo == 0
>...
> I disagree.  I've seen plenty of code which does
> 
> 	#if foo
> or
> 	#if !foo
> 
> and I don't think a "-Dfoo 0" should be required.

Looks like you've seen plenty of code which is confused about the
difference between testing whether a symbol is defined and testing its
value.  That's a fairly fundamental confusion, and it's easily remedied by
using ifdef/ifndef.  I don't see why poor usage becomes an argument in the
standardization process.  (Well, in reality I do; I wish I didn't:-)
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...Relax...don't worry...have a homebrew.



More information about the Comp.lang.c mailing list