public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/28388]  New: stringify (#) operator broken
@ 2006-07-15  5:17 sabre at nondot dot org
  2006-07-15  5:21 ` [Bug preprocessor/28388] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sabre at nondot dot org @ 2006-07-15  5:17 UTC (permalink / raw)
  To: gcc-bugs

GCC warns for:

#define A(b) #b
A(\ \\)

but not for:
#define A(b) #b
A(\`\\)

or seemingly any other character but space.  While "\ " is not a valid escape
in a string, neither is \` or \Z.  Either all or none should be warned about. 
Further, the string should not be chopped into the really illegal result:

"\ \"

Which is what A(\ \\) currently preprocesses to with -E.

-Chris


-- 
           Summary: stringify (#) operator broken
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sabre at nondot dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28388


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

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: stringify (#) operator broken sabre at nondot dot org
@ 2006-07-15  5:21 ` pinskia at gcc dot gnu dot org
  2006-07-15  5:22 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-15  5:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-07-15 05:21 -------
Well it is even worse than that, with the first one, we go into an infinite
loop when you don't use -E.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|stringify (#) operator      |stringify (#) operator
                   |broken                      |broken


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28388


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

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: stringify (#) operator broken sabre at nondot dot org
  2006-07-15  5:21 ` [Bug preprocessor/28388] " pinskia at gcc dot gnu dot org
@ 2006-07-15  5:22 ` pinskia at gcc dot gnu dot org
  2006-07-15  5:23 ` sabre at nondot dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-15  5:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-07-15 05:21 -------
Also without -E, we do warn about the second one:
t.c:2:7: warning: unknown escape sequence '\`'


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28388


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

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: stringify (#) operator broken sabre at nondot dot org
  2006-07-15  5:21 ` [Bug preprocessor/28388] " pinskia at gcc dot gnu dot org
  2006-07-15  5:22 ` pinskia at gcc dot gnu dot org
@ 2006-07-15  5:23 ` sabre at nondot dot org
  2006-07-15  5:25 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sabre at nondot dot org @ 2006-07-15  5:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from sabre at nondot dot org  2006-07-15 05:23 -------
> Also without -E, we do warn about the second one:
> t.c:2:7: warning: unknown escape sequence '\`'

Right, but that is presumably the parser, not the preprocessor doing it... so
it is a bug in the preprocessor.

-Chris


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28388


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

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: stringify (#) operator broken sabre at nondot dot org
                   ` (2 preceding siblings ...)
  2006-07-15  5:23 ` sabre at nondot dot org
@ 2006-07-15  5:25 ` pinskia at gcc dot gnu dot org
  2006-07-15  5:26 ` sabre at nondot dot org
  2007-10-29 19:49 ` manu at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-15  5:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-07-15 05:25 -------
(In reply to comment #3)
> Right, but that is presumably the parser, not the preprocessor doing it... so
> it is a bug in the preprocessor.

Nope, that is the preprocessor doing it, you will notice the column field which
tells you that it is the preprocessor.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28388


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

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: stringify (#) operator broken sabre at nondot dot org
                   ` (3 preceding siblings ...)
  2006-07-15  5:25 ` pinskia at gcc dot gnu dot org
@ 2006-07-15  5:26 ` sabre at nondot dot org
  2007-10-29 19:49 ` manu at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: sabre at nondot dot org @ 2006-07-15  5:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from sabre at nondot dot org  2006-07-15 05:26 -------
Okay, I don't care who does or doesn't do it.  :)  It doesn't get diagnosed in
-E mode, though it's in clear violation of C99 6.10.3.2p2.

-Chris


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28388


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

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: stringify (#) operator broken sabre at nondot dot org
                   ` (4 preceding siblings ...)
  2006-07-15  5:26 ` sabre at nondot dot org
@ 2007-10-29 19:49 ` manu at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-10-29 19:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from manu at gcc dot gnu dot org  2007-10-29 19:48 -------
The infinite loop is still present in GCC 4.3 with

#define A(b) #b
A(\ \\)


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-29 19:48:58
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28388


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

end of thread, other threads:[~2007-10-29 19:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-15  5:17 [Bug preprocessor/28388] New: stringify (#) operator broken sabre at nondot dot org
2006-07-15  5:21 ` [Bug preprocessor/28388] " pinskia at gcc dot gnu dot org
2006-07-15  5:22 ` pinskia at gcc dot gnu dot org
2006-07-15  5:23 ` sabre at nondot dot org
2006-07-15  5:25 ` pinskia at gcc dot gnu dot org
2006-07-15  5:26 ` sabre at nondot dot org
2007-10-29 19:49 ` manu 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).