Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.std.c Subject: Re: comment style Message-ID: <551@taumet.com> Date: 12 Jan 91 18:19:36 GMT References: <616@caslon.cs.arizona.edu> <17968:Jan804:38:1591@kramden.acf.nyu.edu> <1991Jan9.003543.3087@watmath.waterloo.edu> <29161:Jan903:10:3391@kramden.acf.nyu.edu> Organization: Taumetric Corporation, San Diego Lines: 43 thorinn@diku.dk (Lars Henrik Mathiesen) writes: >brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >If the #define wins, // comments cannot be used as line continuations >in macros. Pity, because I liked your idea of merging the comment and >continuation mechanisms. // comments extend *to* the end of the line, not through it. They cannot be used as line continuations. So #define foo bar // use bar instead of foo blah blah is equivalent to #define foo bar blah blah You also cannot use line continuation in the presence of // comments, because the ANSI "phases of translation" apply. The line continuation is applied before comments are recognized, and everything past the // is lost. #define foo // comment here \ bar first becomes #define foo // comment here bar and then becomes #define foo which presumably is not what was intended. NOTE: Not all existing preprocessors treat // comments the same way. What I have stated above is as specified in the latest documentation for C++. Some existing (older) C++ compilers behave differently. For C, // comments are an extension, not part of any standard, so who knows what different compilers will do? -- Steve Clamage, TauMetric Corp, steve@taumet.com