Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!usc!apple!apple.com!wrl From: wrl@apple.com (Wayne Loofbourrow) Newsgroups: comp.lang.c++ Subject: Re: "//" comments and #define's : problems Message-ID: <2867@internal.Apple.COM> Date: 17 Jul 89 21:21:31 GMT References: <1000019@hpclscu.HP.COM> Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 30 In article <1000019@hpclscu.HP.COM> shankar@hpclscu.HP.COM (Shankar Unni) writes: > How should a "//"-comment on a #define work? > > (a) Completely stripped out when processing #define. Not passed through > even when requesting "pass comments". (This is my preference). > > (b) Leave it as is. I.e. specify that a "//"-comment on a #define will > have "undefined" (i.e. nasty and unpredictable) effects. Warn the > user when detected. > > (c) Do some fudge like have "cpp" insert a "/*" and "*/" around the > "//"-style comment, as in > > x b /* // comment */ y Another alternative is to keep all of the text of the #define, _including_ the "\n", as in: x b // comment y This is somewhat like (c), although simpler. Would this work in all cases, or would one need to detect the presence of a // comment first? (Note: it would only be used if user specifies the "pass comments" option) ---------------- Wayne Loofbourrow wrl@apple.com Apple Computer