Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!cvl!elsie!ado From: ado@elsie.UUCP (Arthur David Olson) Newsgroups: comp.lang.c Subject: Re: #include /* comment legal? */ Message-ID: <7517@elsie.UUCP> Date: Sat, 17-Oct-87 21:18:24 EDT Article-I.D.: elsie.7517 Posted: Sat Oct 17 21:18:24 1987 Date-Received: Sun, 18-Oct-87 13:10:37 EDT References: <169@decvax.UUCP> <2205@ihuxy.ATT.COM> Organization: NIH-LEC, Bethesda, MD Lines: 29 In article <2205@ihuxy.ATT.COM>, chapman@ihuxy.ATT.COM (Chapman) writes: > > #define BEAUTY TRUE /* All you need to know */ > > Whether or not a comment may appear after a #define, what's the worst that > can happen? The comment will become part of the definition, but will be > harmless wherever it is substituted. No--the worst thing that can happen is that the preprocessor claims the code is invalid because of the comment in the directive, meaning that you can't compile the code. While it's true that the "translation phases" description in the draft Standard gives a semblance of a guarantee that comments may appear within preprocessor directives, implementors may well have forgotten that guarantee by the time they get to the preprocessor section of the standard. I've previously suggested that where the standard limits the white space characters that may appear in directives to space and horizontal-tab the language should be changed to read horizontal-tab and space (including space characters that replace comments) but the suggestion has not (yet :-) been taken. And to stave off some followups: yes, comments do appear within directives both in the Rationale and in examples within the Standard itself--and remember that neither the Rationale nor examples (nor footnotes) are "officially" part of the Standard. -- ado@vax2.nlm.nih.gov ADO, VAX, and NIH are trademarks of Ampex and DEC.