Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site redwood.UUCP Path: utzoo!utcs!lsuc!pesnta!amdcad!fortune!redwood!rpw3 From: rpw3@redwood.UUCP (Rob Warnock) Newsgroups: net.lang.c Subject: Re: Can #define `token-string' be empty? Message-ID: <169@redwood.UUCP> Date: Fri, 22-Feb-85 01:01:40 EST Article-I.D.: redwood.169 Posted: Fri Feb 22 01:01:40 1985 Date-Received: Fri, 22-Feb-85 15:41:45 EST References: <800003@acf4.UUCP> <151@cci-bdc.UUCP> Organization: [Consultant], Foster City, CA Lines: 24 +--------------- | > Is | > #define X | > valid, i.e., can the `token-string' mentioned on page 207 of K&R be empty? | Yes. the default value of X is 1. | larry... | uucp: ..mit-eddie!cybvax0!cci-bdc!larry | arpa: henrik@mit-mc.ARPA +--------------- Well, almost, Larry. There is no "default" for a "#define"; the empty token-string is perfectly legal. See K & R page 87 for an example of an empty token-string (the "then" macro). You are probably thinking of the case of a symbol defined on the "cc" command line with no value, as in "cc -DFOO bar.c" which defines "FOO" to be 1. But if it is given a value the value is used, even if empty, as in "cc -DFOO= bar.c" which defines "FOO" to be empty, not 1. Rob Warnock Systems Architecture Consultant UUCP: {ihnp4,ucbvax!dual}!fortune!redwood!rpw3 DDD: (415)572-2607 USPS: 510 Trinidad Lane, Foster City, CA 94404