This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: preprocessor/7452: Preprocessor doesn't allow pasting " foo-> ## BAR "


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]