public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8297: problem with preprocessor
@ 2002-10-20 22:56 riteshg
0 siblings, 0 replies; 5+ messages in thread
From: riteshg @ 2002-10-20 22:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 8297
>Category: c++
>Synopsis: problem with preprocessor
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Oct 20 22:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Ritesh goel
>Release: unknown-1.0
>Organization:
>Environment:
linux 7.2
>Description:
when i run
#define comment /##/
comment
the output is coming as space between twp front slash "/ /".
and it is supposed to come "//" . I am using gcc 3.0 . Till
older versions than gcc3.0 it is comming correctly as "//" .
And also in older version preprocessor is not processing the user defined comments as
#define comment /##/
comment
when ran with -E option gives output in preprocessed file
as
//
plzz check it
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/8297: problem with preprocessor
@ 2002-10-21 12:56 Neil Booth
0 siblings, 0 replies; 5+ messages in thread
From: Neil Booth @ 2002-10-21 12:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8297; it has been noted by GNATS.
From: Neil Booth <neil@daikokuya.co.uk>
To: Ritesh Goel <riteshg@pune.tcs.co.in>
Cc: zack@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/8297: problem with preprocessor
Date: Mon, 21 Oct 2002 20:53:58 +0100
Ritesh Goel wrote:-
> Thanx for ur immediate response .
> I want to give comments in my program with using keyword "COMMENT" not
> with // . that should be eliminated during preprocessing .
>
> as COMMENT Line in comment
> instead of
> // Line in comment
>
> I tried to make it using #define but it insert space between that with
> version gcc3.0 .
> It is doing that with previous versions . But there also in the preprocessed
> output it is replacing that with // .
> So when i am taking preprocessed output there, it is taking it as comment .
> And all the comments should be removed in preprocessing . but it is not
> doing that .
>
>
> I am not getting anyway to to do that . Can u help me in that .
This is a Microsoft-ism that we will not duplicate. There is no way
to do what you want with standard C or C++.
Neil.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/8297: problem with preprocessor
@ 2002-10-21 0:16 Ritesh Goel
0 siblings, 0 replies; 5+ messages in thread
From: Ritesh Goel @ 2002-10-21 0:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8297; it has been noted by GNATS.
From: "Ritesh Goel" <riteshg@pune.tcs.co.in>
To: <zack@gcc.gnu.org>,
<gcc-bugs@gcc.gnu.org>,
<gcc-prs@gcc.gnu.org>,
<nobody@gcc.gnu.org>,
<gcc-gnats@gcc.gnu.org>
Cc:
Subject: Re: c++/8297: problem with preprocessor
Date: Mon, 21 Oct 2002 12:39:51 +0530
Thanx for ur immediate response .
I want to give comments in my program with using keyword "COMMENT" not
with // . that should be eliminated during preprocessing .
as COMMENT Line in comment
instead of
// Line in comment
I tried to make it using #define but it insert space between that with
version gcc3.0 .
It is doing that with previous versions . But there also in the preprocessed
output it is replacing that with // .
So when i am taking preprocessed output there, it is taking it as comment .
And all the comments should be removed in preprocessing . but it is not
doing that .
I am not getting anyway to to do that . Can u help me in that .
regards
ritesh
----- Original Message -----
From: <zack@gcc.gnu.org>
To: <gcc-bugs@gcc.gnu.org>; <gcc-prs@gcc.gnu.org>; <nobody@gcc.gnu.org>;
<riteshg@pune.tcs.co.in>
Sent: Monday, October 21, 2002 12:14 PM
Subject: Re: c++/8297: problem with preprocessor
> Synopsis: problem with preprocessor
>
> State-Changed-From-To: open->closed
> State-Changed-By: zack
> State-Changed-When: Sun Oct 20 23:44:56 2002
> State-Changed-Why:
> Not a bug.
>
>
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=8297
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/8297: problem with preprocessor
@ 2002-10-20 23:46 Zack Weinberg
0 siblings, 0 replies; 5+ messages in thread
From: Zack Weinberg @ 2002-10-20 23:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8297; it has been noted by GNATS.
From: Zack Weinberg <zack@codesourcery.com>
To: riteshg@pune.tcs.co.in
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/8297: problem with preprocessor
Date: Sun, 20 Oct 2002 23:42:52 -0700
On Mon, Oct 21, 2002 at 05:46:30AM -0000, riteshg@pune.tcs.co.in wrote:
> when i run
>
> #define comment /##/
> comment
>
> the output is coming as space between twp front slash "/ /".
> and it is supposed to come "//" . I am using gcc 3.0 . Till
> older versions than gcc3.0 it is comming correctly as "//" .
> And also in older version preprocessor is not processing the user
> defined comments as
>
> #define comment /##/
> comment
>
> when ran with -E option gives output in preprocessed file
> as
> //
I'm sorry, but you have it backward. The 2.x preprocessor was buggy;
the behavior of the 3.0 and later preprocessor is correct.
// is not a preprocessing token. If it appears in source text, it
introduces a line comment, which is stripped from the program _before_
the text is broken into tokens. Otherwise, it is simply two "/"
tokens adjacent to each other. You attempted to force the creation of
a single token "//" with the ## operator. This induces undefined
behavior: GCC can do whatever it likes. We choose to have it issue a
warning and pretend there was no ## operator; thus, two "/" tokens are
passed to the output routines. They then have to insert a space, so
that these two "/" tokens are not later misinterpreted as introducing
a line comment.
If you describe what you are actually trying to do, we may be able to
offer advice on how to do it properly.
zw
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c++/8297: problem with preprocessor
@ 2002-10-20 23:44 zack
0 siblings, 0 replies; 5+ messages in thread
From: zack @ 2002-10-20 23:44 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, riteshg
Synopsis: problem with preprocessor
State-Changed-From-To: open->closed
State-Changed-By: zack
State-Changed-When: Sun Oct 20 23:44:56 2002
State-Changed-Why:
Not a bug.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8297
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-10-21 19:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-20 22:56 c++/8297: problem with preprocessor riteshg
2002-10-20 23:44 zack
2002-10-20 23:46 Zack Weinberg
2002-10-21 0:16 Ritesh Goel
2002-10-21 12:56 Neil Booth
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 read-only IMAP folder(s) and NNTP newsgroup(s).