Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!harvard!cmcl2!philabs!mcnc!rti-sel!dg_rtp!meissner From: meissner@dg_rtp.UUCP (Michael Meissner) Newsgroups: net.lang.c Subject: Re: unterminated .h files, __CAT__, etc. Message-ID: <490@dg_rtp.UUCP> Date: Fri, 1-Aug-86 10:24:47 EDT Article-I.D.: dg_rtp.490 Posted: Fri Aug 1 10:24:47 1986 Date-Received: Sat, 2-Aug-86 22:15:19 EDT References: <5722@think.COM> <2244@brl-smoke.ARPA> <470@mcgill-vision.UUCP> Reply-To: meissner@dg_rtp.UUCP (Michael Meissner) Distribution: net Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 36 Keywords: ANSI X3J11 In article <470@mcgill-vision.UUCP> mouse@mcgill-vision.UUCP (der Mouse) writes: > >> __STR__ and __CAT__ were suggested by Tom Plum in a late-night >> working session to resolve the remaining preprocessor issues, > >> The Reiser CPP is definitely out. > >I don't see what's wrong with Reiser cpp's answer to the str and cat >problems (formal substitution in strings and /**/). Could someone >enlighten me? The former (formals inside ""s) can bite, but only if >you're not aware of it (using the same name for a formal and a global >within the macro can bite too, so the possibility of being bitten will >not go away with __STR__). The only thing I can see wrong with /**/ >for __CAT__ is that cc -E -C, such as is used by lint, won't do >contatenation, but the preprocessor could easily be made to strip /**/ >even under -C). There are two main reaons why the reiser cpp's mechanisms (of stringizing and token pasting) have a different syntax in the draft X3J11 standard. First, it is nearly impossible to formalize in a step by step manner (and the main reason for standards is to formalize things), and also the reiser cpp violates K&R (where it states that comments are ALWAYS turned into whitespace, and where it explicitly states that text inside of strings and char constants. The relavant K&R quotes are: page 179: Blanks, tabs, newlines, and COMMENTS (collectively, "white space") as described below are ignored except as they serve to separate tokens. page 207: Text inside a string or a character constant is NOT subject to replacement. Michael Meissner, Data General, ...{decvax}!mcnc!rti-sel!dg_rtp!meissner