Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!decvax!cca!ima!ism780b!jim
From: jim@ism780b.UUCP
Newsgroups: net.lang.c
Subject: Re: Standardization questions (cpp mostl - (nf)
Message-ID: <61@ism780b.UUCP>
Date: Wed, 17-Oct-84 00:40:04 EDT
Article-I.D.: ism780b.61
Posted: Wed Oct 17 00:40:04 1984
Date-Received: Thu, 18-Oct-84 08:21:35 EDT
Lines: 33

#R:decvax:-8300:ism780b:25500030:000:1134
ism780b!jim    Oct 15 14:18:00 1984

>> 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:-)

Look, poor usage is a matter of opinion.  Please show me in print any usage
recommendation that prefers #ifdef foo over #if foo.  Personally, I consider
#ifdef to be an obsolete precursor to #if.  And I think the default
value of "1" rather than "" when -Dfoo is given lends support to that
interpretation.  Given a choice between

#if machine1 || machine2 || machine3

and

#if defined(machine1) || defined(machine2) || defined(machine3)

I prefer the former (and note that the latter was neither documented nor
worked properly (try defined(STANDALONE)) until System V).

-- Jim Balter, INTERACTIVE Systems (ima!jim)