public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* RE: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 20:56 David E. Weekly
  0 siblings, 0 replies; 9+ messages in thread
From: David E. Weekly @ 2002-07-30 20:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7452; it has been noted by GNATS.

From: "David E. Weekly" <david@there.com>
To: "Andrew Pinski" <pinskia@physics.uc.edu>
Cc: <gcc-gnats@gcc.gnu.org>
Subject: RE: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
Date: Tue, 30 Jul 2002 20:51:01 -0700

 Andrew,
 
 Thank you for your patient explanation. If I do wish to use the modern
 preprocessor, is it possible in any way to have some:
 
 #define foo(A) { bar-> ## A() }
 foo( methodOfBar );
 
 Or, without resorting to the "traditional" CPP, can it simply not be done?
 
 Yours,
  David E. Weekly
  Software Developer
  There, Inc.
 
 
 -----Original Message-----
 From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 Sent: Tuesday, July 30, 2002 8:42 PM
 To: David E. Weekly
 Cc: gcc-gnats@gcc.gnu.org
 Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 foo-> ## BAR "
 Importance: High
 
 
 It is illegal because you are trying to paste together two
 tokens which do not make one token in terms of the C standard.
 It has been permanently removed because gcc uses a new
 preprocessor, this has been this way since 3.0.
 You might get what you expect from using the option -traditional-cpp.
 
 Thanks,
 Andrew Pinski
 
 
 
 On Tuesday, July 30, 2002, at 11:30 , David E. Weekly wrote:
 
 > Andrew,
 >
 > Does the standard allow some way to tack on a method name
 > (i.e., "is there
 > another way to do this?"), or has this useful feature simply been
 > permanently removed?
 >
 > Also: why is this construct illegal?
 >
 > Yours,
 >  David E. Weekly
 >  Software Developer
 >  There, Inc.
 >
 > -----Original Message-----
 > From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 > Sent: Tuesday, July 30, 2002 8:23 PM
 > To: david@there.com
 > Cc: gcc-gnats@gcc.gnu.org
 > Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 > foo-> ## BAR "
 > Importance: High
 >
 >
 > What you are doing is illegal according the C standard.
 >
 > Thanks,
 > Andrew Pinski
 >
 >
 >
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 23:37 neil
  0 siblings, 0 replies; 9+ messages in thread
From: neil @ 2002-07-30 23:37 UTC (permalink / raw)
  To: david, gcc-bugs, gcc-prs, neil, nobody

Synopsis: Preprocessor doesn't allow pasting " foo-> ## BAR "

Responsible-Changed-From-To: unassigned->neil
Responsible-Changed-By: neil
Responsible-Changed-When: Tue Jul 30 23:37:01 2002
Responsible-Changed-Why:
    Mine.
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Tue Jul 30 23:37:01 2002
State-Changed-Why:
    Sorry; I'd not seen Andrew's replies before sending my own.
    
    This is not a bug as discussed; submitter has found a way
    to do what he wants.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7452


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 23:36 Neil Booth
  0 siblings, 0 replies; 9+ messages in thread
From: Neil Booth @ 2002-07-30 23:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7452; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: david@there.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
Date: Wed, 31 Jul 2002 07:32:40 +0100

 david@there.com wrote:-
 
 > 	The GNU preprocessor has in the past been able to append method
 > 	names after a "->". It should continue to be able to do so.
 
 It still can.
 
 > 	When in a macro, try to concatenate some "foo->" with a macro parameter
 > 	like BAR; i.e., "foo->##BAR". Note that the preprocessor will complain,
 > 	tossing a warning and the (incorrect) text "foo-> baz" will be tossed
 > 	out. (Assuming macro parameter BAR was set to baz.) Instead, no warning
 > 	should be issued, and the text "foo->baz" should be output.
 
 Why do you feel the need for "##"?  Do you understand what it does?
 If you understand what it does, then you will see that the warning (pre
 3.3) / error (in 3.3) is correct.
 
 C doesn't care about whitespace.  Why do you object to a space being
 after the arrow anyway?
 
 What is wrong with foo->BAR?  That does what you want.
 
 > 	There doesn't seem to be a way to force the preprocessor to accept
 > 	concatenating anything with a left-hand token that ends in "->". =(
 
 Sure there is.  Just don't use ## which does something else.
 
 Neil.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 21:26 David E. Weekly
  0 siblings, 0 replies; 9+ messages in thread
From: David E. Weekly @ 2002-07-30 21:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7452; it has been noted by GNATS.

From: "David E. Weekly" <david@there.com>
To: "Andrew Pinski" <pinskia@physics.uc.edu>
Cc: <gcc-gnats@gcc.gnu.org>
Subject: RE: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
Date: Tue, 30 Jul 2002 21:17:10 -0700

 Andrew,
 
 Thank you. That obvious answer had escaped me.
 
 I'd be happy to have preprocessor/7452 closed as Not A Bug, with your
 helpful comments below attached.
 
 Humbly Yours,
  David E. Weekly
  Software Developer
  There, Inc.
 
 
 -----Original Message-----
 From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 Sent: Tuesday, July 30, 2002 9:01 PM
 To: David E. Weekly
 Cc: gcc-gnats@gcc.gnu.org
 Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 foo-> ## BAR "
 Importance: High
 
 
 The following will work as expected:
 #define foo(A) { bar->A() }
 foo( methodOfBar );
 
 There is no need for pasting.
 The only need for pasting is where you have two identifiers and
 you want them to be one identifier.
 
 Thanks,
 Andrew Pinski
 
 
 
 On Tuesday, July 30, 2002, at 11:51 , David E. Weekly wrote:
 
 > Andrew,
 >
 > Thank you for your patient explanation. If I do wish to use the modern
 > preprocessor, is it possible in any way to have some:
 >
 > #define foo(A) { bar-> ## A() }
 > foo( methodOfBar );
 >
 > Or, without resorting to the "traditional" CPP, can it simply
 > not be done?
 >
 > Yours,
 >  David E. Weekly
 >  Software Developer
 >  There, Inc.
 >
 >
 > -----Original Message-----
 > From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 > Sent: Tuesday, July 30, 2002 8:42 PM
 > To: David E. Weekly
 > Cc: gcc-gnats@gcc.gnu.org
 > Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 > foo-> ## BAR "
 > Importance: High
 >
 >
 > It is illegal because you are trying to paste together two
 > tokens which do not make one token in terms of the C standard.
 > It has been permanently removed because gcc uses a new
 > preprocessor, this has been this way since 3.0.
 > You might get what you expect from using the option -traditional-cpp.
 >
 > Thanks,
 > Andrew Pinski
 >
 >
 >
 > On Tuesday, July 30, 2002, at 11:30 , David E. Weekly wrote:
 >
 >> Andrew,
 >>
 >> Does the standard allow some way to tack on a method name
 >> (i.e., "is there
 >> another way to do this?"), or has this useful feature simply been
 >> permanently removed?
 >>
 >> Also: why is this construct illegal?
 >>
 >> Yours,
 >>  David E. Weekly
 >>  Software Developer
 >>  There, Inc.
 >>
 >> -----Original Message-----
 >> From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 >> Sent: Tuesday, July 30, 2002 8:23 PM
 >> To: david@there.com
 >> Cc: gcc-gnats@gcc.gnu.org
 >> Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 >> foo-> ## BAR "
 >> Importance: High
 >>
 >>
 >> What you are doing is illegal according the C standard.
 >>
 >> Thanks,
 >> Andrew Pinski
 >>
 >>
 >>
 >
 >
 >
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 21:06 Andrew Pinski
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Pinski @ 2002-07-30 21:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7452; it has been noted by GNATS.

From: Andrew Pinski <pinskia@physics.uc.edu>
To: "David E. Weekly" <david@there.com>
Cc: <gcc-gnats@gcc.gnu.org>
Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
Date: Wed, 31 Jul 2002 00:01:00 -0400

 The following will work as expected:
 #define foo(A) { bar->A() }
 foo( methodOfBar );
 
 There is no need for pasting.
 The only need for pasting is where you have two identifiers and 
 you want them to be one identifier.
 
 Thanks,
 Andrew Pinski
 
 
 
 On Tuesday, July 30, 2002, at 11:51 , David E. Weekly wrote:
 
 > Andrew,
 >
 > Thank you for your patient explanation. If I do wish to use the modern
 > preprocessor, is it possible in any way to have some:
 >
 > #define foo(A) { bar-> ## A() }
 > foo( methodOfBar );
 >
 > Or, without resorting to the "traditional" CPP, can it simply 
 > not be done?
 >
 > Yours,
 >  David E. Weekly
 >  Software Developer
 >  There, Inc.
 >
 >
 > -----Original Message-----
 > From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 > Sent: Tuesday, July 30, 2002 8:42 PM
 > To: David E. Weekly
 > Cc: gcc-gnats@gcc.gnu.org
 > Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 > foo-> ## BAR "
 > Importance: High
 >
 >
 > It is illegal because you are trying to paste together two
 > tokens which do not make one token in terms of the C standard.
 > It has been permanently removed because gcc uses a new
 > preprocessor, this has been this way since 3.0.
 > You might get what you expect from using the option -traditional-cpp.
 >
 > Thanks,
 > Andrew Pinski
 >
 >
 >
 > On Tuesday, July 30, 2002, at 11:30 , David E. Weekly wrote:
 >
 >> Andrew,
 >>
 >> Does the standard allow some way to tack on a method name
 >> (i.e., "is there
 >> another way to do this?"), or has this useful feature simply been
 >> permanently removed?
 >>
 >> Also: why is this construct illegal?
 >>
 >> Yours,
 >>  David E. Weekly
 >>  Software Developer
 >>  There, Inc.
 >>
 >> -----Original Message-----
 >> From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 >> Sent: Tuesday, July 30, 2002 8:23 PM
 >> To: david@there.com
 >> Cc: gcc-gnats@gcc.gnu.org
 >> Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 >> foo-> ## BAR "
 >> Importance: High
 >>
 >>
 >> What you are doing is illegal according the C standard.
 >>
 >> Thanks,
 >> Andrew Pinski
 >>
 >>
 >>
 >
 >
 >
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 20:46 Andrew Pinski
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Pinski @ 2002-07-30 20:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7452; it has been noted by GNATS.

From: Andrew Pinski <pinskia@physics.uc.edu>
To: "David E. Weekly" <david@there.com>
Cc: <gcc-gnats@gcc.gnu.org>
Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
Date: Tue, 30 Jul 2002 23:41:52 -0400

 It is illegal because you are trying to paste together two 
 tokens which do not make one token in terms of the C standard.
 It has been permanently removed because gcc uses a new 
 preprocessor, this has been this way since 3.0.
 You might get what you expect from using the option -traditional-cpp.
 
 Thanks,
 Andrew Pinski
 
 
 
 On Tuesday, July 30, 2002, at 11:30 , David E. Weekly wrote:
 
 > Andrew,
 >
 > Does the standard allow some way to tack on a method name 
 > (i.e., "is there
 > another way to do this?"), or has this useful feature simply been
 > permanently removed?
 >
 > Also: why is this construct illegal?
 >
 > Yours,
 >  David E. Weekly
 >  Software Developer
 >  There, Inc.
 >
 > -----Original Message-----
 > From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 > Sent: Tuesday, July 30, 2002 8:23 PM
 > To: david@there.com
 > Cc: gcc-gnats@gcc.gnu.org
 > Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 > foo-> ## BAR "
 > Importance: High
 >
 >
 > What you are doing is illegal according the C standard.
 >
 > Thanks,
 > Andrew Pinski
 >
 >
 >
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 20:36 David E. Weekly
  0 siblings, 0 replies; 9+ messages in thread
From: David E. Weekly @ 2002-07-30 20:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7452; it has been noted by GNATS.

From: "David E. Weekly" <david@there.com>
To: "Andrew Pinski" <pinskia@physics.uc.edu>
Cc: <gcc-gnats@gcc.gnu.org>
Subject: RE: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
Date: Tue, 30 Jul 2002 20:30:01 -0700

 Andrew,
 
 Does the standard allow some way to tack on a method name (i.e., "is there
 another way to do this?"), or has this useful feature simply been
 permanently removed?
 
 Also: why is this construct illegal?
 
 Yours,
  David E. Weekly
  Software Developer
  There, Inc.
 
 -----Original Message-----
 From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
 Sent: Tuesday, July 30, 2002 8:23 PM
 To: david@there.com
 Cc: gcc-gnats@gcc.gnu.org
 Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting "
 foo-> ## BAR "
 Importance: High
 
 
 What you are doing is illegal according the C standard.
 
 Thanks,
 Andrew Pinski
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 20:26 Andrew Pinski
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Pinski @ 2002-07-30 20:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/7452; it has been noted by GNATS.

From: Andrew Pinski <pinskia@physics.uc.edu>
To: david@there.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
Date: Tue, 30 Jul 2002 23:22:43 -0400

 What you are doing is illegal according the C standard.
 
 Thanks,
 Andrew Pinski
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "
@ 2002-07-30 20:06 david
  0 siblings, 0 replies; 9+ messages in thread
From: david @ 2002-07-30 20:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7452
>Category:       preprocessor
>Synopsis:       Preprocessor doesn't allow pasting " foo-> ## BAR "
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 30 20:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     root
>Release:        3.1.1
>Organization:
There, Inc.
>Environment:
System: Linux dewdev3.there.com 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.1.1/configure --prefix=/usr/local/gcc-3.1.1 --program-suffix=-311 --enable-languages=c,c++ --enable-version-specific-runtime-libs --with-dwarf2 --disable-nls
>Description:
	The GNU preprocessor has in the past been able to append method
	names after a "->". It should continue to be able to do so.
>How-To-Repeat:
	When in a macro, try to concatenate some "foo->" with a macro parameter
	like BAR; i.e., "foo->##BAR". Note that the preprocessor will complain,
	tossing a warning and the (incorrect) text "foo-> baz" will be tossed
	out. (Assuming macro parameter BAR was set to baz.) Instead, no warning
	should be issued, and the text "foo->baz" should be output.
>Fix:
	There doesn't seem to be a way to force the preprocessor to accept
	concatenating anything with a left-hand token that ends in "->". =(

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-07-31  6:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-30 20:56 preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR " David E. Weekly
  -- strict thread matches above, loose matches on Subject: below --
2002-07-30 23:37 neil
2002-07-30 23:36 Neil Booth
2002-07-30 21:26 David E. Weekly
2002-07-30 21:06 Andrew Pinski
2002-07-30 20:46 Andrew Pinski
2002-07-30 20:36 David E. Weekly
2002-07-30 20:26 Andrew Pinski
2002-07-30 20:06 david

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).