From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4474ff21207aa9cf44a6e3f715f6b492@plan9.bell-labs.com> From: David Presotto To: enache@rdslink.ro, 9fans@cse.psu.edu Subject: Re: [9fans] plan9's C compiler and // comments MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-agdthactmrkbuhgmmqvephaiuq" Date: Sun, 14 Sep 2003 23:06:23 -0400 Topicbox-Message-UUID: 35f916ea-eacc-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-agdthactmrkbuhgmmqvephaiuq Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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. --upas-agdthactmrkbuhgmmqvephaiuq Content-Type: message/rfc822 Content-Disposition: inline Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Sun Sep 14 22:24:18 EDT 2003 Received: from mail.cse.psu.edu ([130.203.4.6]) by plan9; Sun Sep 14 22:24:16 EDT 2003 Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 0CE4419B1E; Sun, 14 Sep 2003 22:24:15 -0400 (EDT) Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.16.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 2046D199D5; Sun, 14 Sep 2003 22:24:11 -0400 (EDT) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id D85AC19AF8; Sun, 14 Sep 2003 22:23:51 -0400 (EDT) Received: from mail.rdslink.ro (mail.rdslink.ro [193.231.236.20]) by mail.cse.psu.edu (CSE Mail Server) with SMTP id 94840199D5 for <9fans@cse.psu.edu>; Sun, 14 Sep 2003 22:23:50 -0400 (EDT) Received: (qmail 18995 invoked from network); 15 Sep 2003 02:20:35 -0000 Received: from unknown (HELO ratsnest.hole) (81.196.247.25) by mail.rdslink.ro with SMTP; 15 Sep 2003 02:20:35 -0000 From: Enache Adrian To: 9fans@cse.psu.edu Subject: Re: [9fans] plan9's C compiler and // comments Message-ID: <20030915022121.GC1290@ratsnest.hole> Mail-Followup-To: 9fans@cse.psu.edu References: <1e56ac67c75ab0ab0d61e9569b44f97f@plan9.bell-labs.com> <20030915011658.GB1290@ratsnest.hole> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030915011658.GB1290@ratsnest.hole> User-Agent: Mutt/1.4i Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Mon, 15 Sep 2003 05:21:21 +0300 X-Spam-Status: No, hits=-3.5 required=5.0 tests=IN_REP_TO,REFERENCES,USER_AGENT_MUTT version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) > 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 --upas-agdthactmrkbuhgmmqvephaiuq--