public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/22042] New: stringification BUG
@ 2005-06-13  5:27 s__nakayama at infoseek dot jp
  2005-06-13 12:36 ` [Bug preprocessor/22042] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: s__nakayama at infoseek dot jp @ 2005-06-13  5:27 UTC (permalink / raw)
  To: gcc-bugs

// test code
#define S(X) S2(X)
#define S2(X) #X
#define TAB "	" /* 0x09 */

S(S(TAB))


// gcc -E -P OUTPUT

"\"\\\"\\011\\\"\""

// expected result

"\"\\\"	\\\"\""


GCC # preprocessing operator converts the non-printable characters to octal.
But this behavior is non standard.

-- 
           Summary: stringification BUG
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: s__nakayama at infoseek dot jp
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug preprocessor/22042] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
@ 2005-06-13 12:36 ` pinskia at gcc dot gnu dot org
  2005-06-14  7:21 ` s__nakayama at infoseek dot jp
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-13 12:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-13 12:36 -------
I don't see why this is really a bug because if you output the string, it will look the same.

-- 


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


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

* [Bug preprocessor/22042] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
  2005-06-13 12:36 ` [Bug preprocessor/22042] " pinskia at gcc dot gnu dot org
@ 2005-06-14  7:21 ` s__nakayama at infoseek dot jp
  2005-06-19 16:27 ` s__nakayama at infoseek dot jp
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: s__nakayama at infoseek dot jp @ 2005-06-14  7:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From s__nakayama at infoseek dot jp  2005-06-14 07:20 -------
(In reply to comment #1)
Hmm, it does't look the same.

// test code
#define S(X) S2(X)
#define S2(X) #X
#define TAB "	" /* 0x09 */

main()
{
  puts(S(S(TAB)));
}

// GCC 4.0.0 result
"\"\011\""

// GCC 2.95.3 result(expected result)
"\"	\""



-- 


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


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

* [Bug preprocessor/22042] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
  2005-06-13 12:36 ` [Bug preprocessor/22042] " pinskia at gcc dot gnu dot org
  2005-06-14  7:21 ` s__nakayama at infoseek dot jp
@ 2005-06-19 16:27 ` s__nakayama at infoseek dot jp
  2005-06-23 15:35 ` s__nakayama at infoseek dot jp
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: s__nakayama at infoseek dot jp @ 2005-06-19 16:27 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.0.4 3.2.3 3.3.3 3.3.6
                   |                            |3.4.4 4.0.0
      Known to work|                            |2.95.3


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


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

* [Bug preprocessor/22042] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
                   ` (2 preceding siblings ...)
  2005-06-19 16:27 ` s__nakayama at infoseek dot jp
@ 2005-06-23 15:35 ` s__nakayama at infoseek dot jp
  2005-07-09 16:34 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: s__nakayama at infoseek dot jp @ 2005-06-23 15:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From s__nakayama at infoseek dot jp  2005-06-23 15:35 -------
(In reply to comment #1)
> I don't see why this is really a bug because if you output the string, it 
will look the same.

NO! Your guess is wrong.
I never report, if the output always looks the same.
I wrote the sample if you output the string, it do not look the same.



-- 


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


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

* [Bug preprocessor/22042] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
                   ` (3 preceding siblings ...)
  2005-06-23 15:35 ` s__nakayama at infoseek dot jp
@ 2005-07-09 16:34 ` pinskia at gcc dot gnu dot org
  2005-07-09 18:32 ` s__nakayama at infoseek dot jp
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-09 16:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-09 16:29 -------
Huh? I cannot reproduce it at all.
with all of the versions of GCC I tried from 2.95.3 to 4.1.0 I get the following:
"\"\\\"   \\\"\""


-- 


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


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

* [Bug preprocessor/22042] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
                   ` (4 preceding siblings ...)
  2005-07-09 16:34 ` pinskia at gcc dot gnu dot org
@ 2005-07-09 18:32 ` s__nakayama at infoseek dot jp
  2005-07-09 18:51 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: s__nakayama at infoseek dot jp @ 2005-07-09 18:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From s__nakayama at infoseek dot jp  2005-07-09 18:23 -------
(In reply to comment #4)
> Huh? I cannot reproduce it at all.
> with all of the versions of GCC I tried from 2.95.3 to 4.1.0 I get the 
following:
> "\"\\\"   \\\"\""

Did you confirm there was a tab in the string?
I consider that your code is the tab has been converted into space.
If there is a tab in the string,
try the string including other suitable non-printable character.


-- 


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


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

* [Bug preprocessor/22042] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
                   ` (5 preceding siblings ...)
  2005-07-09 18:32 ` s__nakayama at infoseek dot jp
@ 2005-07-09 18:51 ` pinskia at gcc dot gnu dot org
  2005-07-13 13:13 ` [Bug preprocessor/22042] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-09 18:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-09 18:32 -------
The relevant part of the standard (C99: 6.10.3.2P2)
Otherwise, the original spelling of each preprocessing token in the argument is retained in the 
character string literal, except for special handling for producing the spelling of string literals and 
character constants: a\character is inserted before each" and \character of a character constant or 
string literal (including the delimiting " characters), except that it is implementation-defined whether 
a\character is inserted before the\character beginning a universal character name. If the replacement 
that results is not a valid character string literal, the behavior is undefined. The character string literal 
corresponding to an empty argument is ""

-- 


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


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

* [Bug preprocessor/22042] [3.4/4.0/4.1 Regression] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
                   ` (6 preceding siblings ...)
  2005-07-09 18:51 ` pinskia at gcc dot gnu dot org
@ 2005-07-13 13:13 ` pinskia at gcc dot gnu dot org
  2005-07-22 21:18 ` pinskia at gcc dot gnu dot org
  2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-13 13:13 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
            Summary|stringification BUG         |[3.4/4.0/4.1 Regression]
                   |                            |stringification BUG
   Target Milestone|---                         |3.4.5


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


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

* [Bug preprocessor/22042] [3.4/4.0/4.1 Regression] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
                   ` (7 preceding siblings ...)
  2005-07-13 13:13 ` [Bug preprocessor/22042] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-07-22 21:18 ` pinskia at gcc dot gnu dot org
  2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-22 21:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-22 21:13 -------
Moving to 4.0.2 pre Mark.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.5                       |4.0.2


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


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

* [Bug preprocessor/22042] [3.4/4.0/4.1 Regression] stringification BUG
  2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
                   ` (8 preceding siblings ...)
  2005-07-22 21:18 ` pinskia at gcc dot gnu dot org
@ 2005-09-27 16:13 ` mmitchel at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:13 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

end of thread, other threads:[~2005-09-27 16:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-13  5:27 [Bug preprocessor/22042] New: stringification BUG s__nakayama at infoseek dot jp
2005-06-13 12:36 ` [Bug preprocessor/22042] " pinskia at gcc dot gnu dot org
2005-06-14  7:21 ` s__nakayama at infoseek dot jp
2005-06-19 16:27 ` s__nakayama at infoseek dot jp
2005-06-23 15:35 ` s__nakayama at infoseek dot jp
2005-07-09 16:34 ` pinskia at gcc dot gnu dot org
2005-07-09 18:32 ` s__nakayama at infoseek dot jp
2005-07-09 18:51 ` pinskia at gcc dot gnu dot org
2005-07-13 13:13 ` [Bug preprocessor/22042] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-07-22 21:18 ` pinskia at gcc dot gnu dot org
2005-09-27 16:13 ` mmitchel 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).