Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!ima!haddock!karl From: karl@haddock.UUCP Newsgroups: comp.lang.c Subject: Re: RMS comments to X3J11 Message-ID: <303@haddock.UUCP> Date: Thu, 15-Jan-87 18:20:24 EST Article-I.D.: haddock.303 Posted: Thu Jan 15 18:20:24 1987 Date-Received: Fri, 16-Jan-87 06:53:26 EST References: <2144@brl-adm.ARPA> <5497@brl-smoke.ARPA> <1258@ho95e.UUCP> Reply-To: karl@haddock.ISC.COM.UUCP (Karl Heuer) Organization: Interactive Systems, Boston Lines: 26 In article <1258@ho95e.UUCP> wcs@ho95e.UUCP (Bill Stewart) writes: >Doug's suggestion was to have such constants start with _sys_ and _mach_, >e.g. _sys_43bsd or _mach_vax. As an alternative, why not let >_sys_ and _machine_ be preprocessor variables, leading to > #define _sys_ SysVR2 > #define _machine_ u3b2 >and > #if _machine_ = vax [I presume that was a typo for "==". --kwzh] Your suggestion is incomplete. In cpp as currently implemented, your "#if" would expand into "#if u3b2 == vax" which would be true (!) since tokens with no definitions are evaluated as zero. Perhaps you're assuming a hook in cpp to recognize such a comparison and use the token names instead of their values. (Perhaps you even intended "=", as opposed to "==", to distinguish this operation? I hope not.) I think such a rule is too confusing. Someone else already suggested a variant that I think is more viable: #define _machine_ "u3b2" could be tested by some comparison operator. Either "==" or "strcmp(,)==0" could be used, but since the interpretation is not identical to that of C, I will suggest a new preprocessor operator "#==". Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint