Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!mcnc!rti!xyzzy!meissner From: meissner@xyzzy.UUCP (Michael Meissner) Newsgroups: comp.lang.c Subject: Re: Are the criteria for Unix and PC compilers different? Message-ID: <680@xyzzy.UUCP> Date: 9 Mar 88 21:29:13 GMT References: <2232abb7@ralf.home> Reply-To: meissner@xyzzy.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 19 In article <2232abb7@ralf.home> Ralf.Brown@B.GP.CS.CMU.EDU writes: | In article <7451@oberon.USC.EDU>, blarson@skat.usc.edu (Bob Larson) writes: | }In article <22314ad9@ralf.home> Ralf.Brown@B.GP.CS.CMU.EDU writes: | }>#define int long | } | }* Does not work on compilers that don't allow #define of a keyword. | | I wasn't aware of any preprocessors smart enough to disallow #defines of | keywords. The preprocessor's knowledge of C is limited to recognizing tokens; | it doesn't "know" C, it just does the textual substitution. In the traditional UNIX/cpp yes, /lib/cpp "only" recognizes tokens. It is not engraved in stone tablets, that this is the one true course. Other compilers have the preprocessor integrated in the compiler proper, and yes some of those do warn and/or disallow #define'ing keywords. For instance, early rev's of the Data General C compiler gave warnings about that, as well as some of the micro compilers. -- Michael Meissner, Data General. Uucp: ...!mcnc!rti!xyzzy!meissner Arpa/Csnet: meissner@dg-rtp.DG.COM