public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/28388] stringify (#) operator broken
       [not found] <bug-28388-4@http.gcc.gnu.org/bugzilla/>
@ 2023-02-06 12:19 ` rguenth at gcc dot gnu.org
  2023-02-06 12:35 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-02-06 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #6)
> The infinite loop is still present in GCC 4.3 with
> 
> #define A(b) #b
> A(\ \\)

This now seems to work.  I can confirm the issue with GCC 4.3 but GCC 7
already does

t.c:2:7: warning: invalid string literal, ignoring final '\'
 A(\ \\)
       ^
t.c:2:7: warning: unknown escape sequence: '\040'
t.c:2:7: error: expected identifier or '(' before string constant
 A(\ \\)
       ^
t.c:1:15: note: in definition of macro 'A'
 #define A(b) #b
               ^

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

* [Bug preprocessor/28388] stringify (#) operator broken
       [not found] <bug-28388-4@http.gcc.gnu.org/bugzilla/>
  2023-02-06 12:19 ` [Bug preprocessor/28388] stringify (#) operator broken rguenth at gcc dot gnu.org
@ 2023-02-06 12:35 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2023-02-06 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
r239175 seemed to fix it: "On-demand locations within string-literals"

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

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: " 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; 8+ 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] 8+ messages in thread

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: " 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; 8+ 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] 8+ messages in thread

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: " 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; 8+ 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] 8+ messages in thread

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: " 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; 8+ 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] 8+ messages in thread

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: " 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; 8+ 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] 8+ messages in thread

* [Bug preprocessor/28388] stringify (#) operator broken
  2006-07-15  5:17 [Bug preprocessor/28388] New: " 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; 8+ 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] 8+ messages in thread

end of thread, other threads:[~2023-02-06 12:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-28388-4@http.gcc.gnu.org/bugzilla/>
2023-02-06 12:19 ` [Bug preprocessor/28388] stringify (#) operator broken rguenth at gcc dot gnu.org
2023-02-06 12:35 ` redi at gcc dot gnu.org
2006-07-15  5:17 [Bug preprocessor/28388] New: " 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).