From: David Presotto <presotto@closedmind.org>
To: enache@rdslink.ro, 9fans@cse.psu.edu
Subject: Re: [9fans] plan9's C compiler and // comments
Date: Sun, 14 Sep 2003 23:06:23 -0400 [thread overview]
Message-ID: <4474ff21207aa9cf44a6e3f715f6b492@plan9.bell-labs.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 402 bytes --]
Looks like just the opposite to me. /**/ comments are handled specially.
The prepocessor doesn't know anything about // comments. If you want to
change it, I wouldn't mind. I think nobody ever thought of or cared to
do it before because we frown so much on programming with the preprocessor.
The // at the end of your endif makes it through only because everything after the
endif is ignored.
[-- Attachment #2: Type: message/rfc822, Size: 2629 bytes --]
From: Enache Adrian <enache@rdslink.ro>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] plan9's C compiler and // comments
Date: Mon, 15 Sep 2003 05:21:21 +0300
Message-ID: <20030915022121.GC1290@ratsnest.hole>
> On Sun, Sep 14, 2003 a.d., David Presotto wrote:
> > It accepts it just fine. You're just defining a macro as
> >
> > "wow!" // this won't work
> >
> > and when it gets expanded in the exits you get
> >
> > void main() { exits("wow!" // this won't work); }
Judging about what I understand of cmd/cc/macbody:237-260,
ex. the /**/ comments are not passed through macros to be dealt with
later, but discarded during the parsing of the '#define' directive.
So the handling of '//' comments is just special in this case.
Regards,
Adi
next reply other threads:[~2003-09-15 3:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-15 3:06 David Presotto [this message]
2003-09-15 3:14 ` mirtchov
2003-09-15 3:19 ` David Presotto
2003-09-15 7:11 ` Charles Forsyth
2003-09-15 7:51 ` boyd, rounin
2003-09-15 8:23 ` boyd, rounin
2003-09-15 3:21 ` Bruce Ellis
2003-09-15 8:00 ` boyd, rounin
2003-09-15 4:06 ` Enache Adrian
2003-09-15 7:03 ` Charles Forsyth
2003-09-15 7:49 ` boyd, rounin
2003-09-15 8:01 ` Geoff Collyer
[not found] <1630899296@snellwilcox.com>
2003-09-15 11:01 ` steve.simon
2003-09-15 11:23 ` C H Forsyth
2003-09-15 11:26 ` C H Forsyth
-- strict thread matches above, loose matches on Subject: below --
2003-09-15 1:02 David Presotto
2003-09-15 1:16 ` Enache Adrian
2003-09-15 1:23 ` boyd, rounin
2003-09-15 7:21 ` Charles Forsyth
2003-09-15 2:21 ` Enache Adrian
2003-09-15 0:49 Enache Adrian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4474ff21207aa9cf44a6e3f715f6b492@plan9.bell-labs.com \
--to=presotto@closedmind.org \
--cc=9fans@cse.psu.edu \
--cc=enache@rdslink.ro \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).