public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/35610] New: Pasting "foo" and "(" does not give a valid preprocessing token
@ 2008-03-16 22:44 andry at inbox dot ru
2008-03-16 22:46 ` [Bug preprocessor/35610] " pinskia at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: andry at inbox dot ru @ 2008-03-16 22:44 UTC (permalink / raw)
To: gcc-bugs
MSVC++ from 2003 to 2008 and comeau compiler v4.9.3b gives no errors about
that:
//---------------------------------------------
#define CAT(a,b) a ## b
void foo(int a) {}
void foo(int a,int b) {}
int main() {
CAT(foo,(1)); //error
CAT(foo,(1,2)); //error
return 0;
}
//---------------------------------------------
--
Summary: Pasting "foo" and "(" does not give a valid
preprocessing token
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andry at inbox dot ru
GCC host triplet: i686-pc-cygwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35610
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug preprocessor/35610] Pasting "foo" and "(" does not give a valid preprocessing token
2008-03-16 22:44 [Bug preprocessor/35610] New: Pasting "foo" and "(" does not give a valid preprocessing token andry at inbox dot ru
@ 2008-03-16 22:46 ` pinskia at gcc dot gnu dot org
2008-03-16 22:50 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-03-16 22:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-03-16 22:46 -------
Yes and GCC behavior is correct. pasting foo and ( don't make a valid
preprocessing token.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
Summary|Pasting "foo" and "(" does |Pasting "foo" and "(" does
|not give a valid |not give a valid
|preprocessing token |preprocessing token
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35610
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug preprocessor/35610] Pasting "foo" and "(" does not give a valid preprocessing token
2008-03-16 22:44 [Bug preprocessor/35610] New: Pasting "foo" and "(" does not give a valid preprocessing token andry at inbox dot ru
2008-03-16 22:46 ` [Bug preprocessor/35610] " pinskia at gcc dot gnu dot org
@ 2008-03-16 22:50 ` pinskia at gcc dot gnu dot org
2008-03-16 22:57 ` andry at inbox dot ru
2008-03-16 23:07 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-03-16 22:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-03-16 22:49 -------
## only works to form a valid token, if it does not, then the code is invalid.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35610
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug preprocessor/35610] Pasting "foo" and "(" does not give a valid preprocessing token
2008-03-16 22:44 [Bug preprocessor/35610] New: Pasting "foo" and "(" does not give a valid preprocessing token andry at inbox dot ru
2008-03-16 22:46 ` [Bug preprocessor/35610] " pinskia at gcc dot gnu dot org
2008-03-16 22:50 ` pinskia at gcc dot gnu dot org
@ 2008-03-16 22:57 ` andry at inbox dot ru
2008-03-16 23:07 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: andry at inbox dot ru @ 2008-03-16 22:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from andry at inbox dot ru 2008-03-16 22:56 -------
(In reply to comment #2)
> ## only works to form a valid token, if it does not, then the code is invalid.
>
When i can understand which token is valid then?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35610
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug preprocessor/35610] Pasting "foo" and "(" does not give a valid preprocessing token
2008-03-16 22:44 [Bug preprocessor/35610] New: Pasting "foo" and "(" does not give a valid preprocessing token andry at inbox dot ru
` (2 preceding siblings ...)
2008-03-16 22:57 ` andry at inbox dot ru
@ 2008-03-16 23:07 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-03-16 23:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2008-03-16 23:06 -------
(In reply to comment #3)
> When i can understand which token is valid then?
By reading the C/C++ standards :). But basically in this case foo and ( are
two different tokens. Examples of valid tokens: "->", "foo", ".", ",", etc.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35610
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-03-16 23:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-16 22:44 [Bug preprocessor/35610] New: Pasting "foo" and "(" does not give a valid preprocessing token andry at inbox dot ru
2008-03-16 22:46 ` [Bug preprocessor/35610] " pinskia at gcc dot gnu dot org
2008-03-16 22:50 ` pinskia at gcc dot gnu dot org
2008-03-16 22:57 ` andry at inbox dot ru
2008-03-16 23:07 ` pinskia at gcc dot gnu dot org
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).