public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/25717]  New: -dM does not list all defined macros (in particular, __STDC__)
@ 2006-01-08 22:51 shaun4477 at gmail dot com
  2006-01-09  0:27 ` [Bug preprocessor/25717] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: shaun4477 at gmail dot com @ 2006-01-08 22:51 UTC (permalink / raw)
  To: gcc-bugs

The -dM option is documented to provide a complete list of all defined macros,
including all predefined macros, however the list is incomplete. In particular,
the following will not list __STDC__ even though it is defined:

   touch test.h; gcc -dM test.h

If you modify test.h to include:

   #ifdef __STDC__
      #error __STDC__ is defined
   #endif

The compilation will result in an error


-- 
           Summary: -dM does not list all defined macros (in particular,
                    __STDC__)
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: shaun4477 at gmail dot com
 GCC build triplet: ia64-hp-hpux11.23
  GCC host triplet: ia64-hp-hpux11.23
GCC target triplet: ia64-hp-hpux11.23


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



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

* [Bug preprocessor/25717] -dM does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
@ 2006-01-09  0:27 ` pinskia at gcc dot gnu dot org
  2006-01-09  1:28 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-09  0:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-01-09 00:27 -------
Hmm, __STDC__ is treated special inside the preprocessor.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|ia64-hp-hpux11.23           |
   GCC host triplet|ia64-hp-hpux11.23           |
 GCC target triplet|ia64-hp-hpux11.23           |


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



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

* [Bug preprocessor/25717] -dM does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
  2006-01-09  0:27 ` [Bug preprocessor/25717] " pinskia at gcc dot gnu dot org
@ 2006-01-09  1:28 ` pinskia at gcc dot gnu dot org
  2006-01-09  1:30 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-09  1:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-01-09 01:28 -------
Actually this is a true bug and it was fixed in the past too:
http://gcc.gnu.org/ml/gcc-patches/2001-02/msg01533.html

I have to see where it started to fail now.

Confirmed.


-- 

pinskia 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         |2006-01-09 01:28:51
               date|                            |


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



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

* [Bug preprocessor/25717] -dM does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
  2006-01-09  0:27 ` [Bug preprocessor/25717] " pinskia at gcc dot gnu dot org
  2006-01-09  1:28 ` pinskia at gcc dot gnu dot org
@ 2006-01-09  1:30 ` pinskia at gcc dot gnu dot org
  2006-01-09  1:31 ` [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-09  1:30 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.3.3 3.4.0 4.0.0 4.1.0
                   |                            |4.2.0
      Known to work|                            |3.2.3
   Target Milestone|---                         |4.0.3


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



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

* [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dM does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (2 preceding siblings ...)
  2006-01-09  1:30 ` pinskia at gcc dot gnu dot org
@ 2006-01-09  1:31 ` pinskia at gcc dot gnu dot org
  2006-01-09 21:57 ` steven at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-09  1:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-01-09 01:31 -------
Hmm, when cpp0 was removed in 3.3, this was caused.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|-dM does not list all       |[3.4/4.0/4.1/4.2 Regression]
                   |defined macros (in          |-dM does not list all
                   |particular, __STDC__)       |defined macros (in
                   |                            |particular, __STDC__)


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



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

* [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dM does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (3 preceding siblings ...)
  2006-01-09  1:31 ` [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-01-09 21:57 ` steven at gcc dot gnu dot org
  2006-01-09 22:00 ` steven at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-01-09 21:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from steven at gcc dot gnu dot org  2006-01-09 21:57 -------
Your command line:

   touch test.h; gcc -dM test.h

creates a precompiled header.

Also, my documentation for -dM says:

@item -dM
@itemx -fdump-rtl-mach
@opindex dM
@opindex fdump-rtl-mach
Dump after performing the machine dependent reorganization pass, to
@file{@var{file}.35.mach}.


What you want is -dD.  But I'm not sure what that is supposed to write out. 
GCC 3.3, 4.0, and 4.1 all give no output at all for an empty file, or a file
with a single #define.


-- 


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



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

* [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dM does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (4 preceding siblings ...)
  2006-01-09 21:57 ` steven at gcc dot gnu dot org
@ 2006-01-09 22:00 ` steven at gcc dot gnu dot org
  2006-01-09 22:08 ` [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dD " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-01-09 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from steven at gcc dot gnu dot org  2006-01-09 22:00 -------
I get a lot of output with:
$ gcc -E -dD test.c

Perhaps that is what you're looking for.  This looks more like a documentation
bug to me than a real preprocessor bug.


-- 


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



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

* [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dD does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (5 preceding siblings ...)
  2006-01-09 22:00 ` steven at gcc dot gnu dot org
@ 2006-01-09 22:08 ` pinskia at gcc dot gnu dot org
  2006-01-15 22:30 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-09 22:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-01-09 22:08 -------
(In reply to comment #5)
> I get a lot of output with:
> $ gcc -E -dD test.c
> 
> Perhaps that is what you're looking for.  This looks more like a documentation
> bug to me than a real preprocessor bug.

It is not, -dD should include __STDC__ and it does in pre 3.3 but not post 3.3
when cpp0 went away.  I forgot to update the summary when I confirmed it after
fixing the testcase.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[3.4/4.0/4.1/4.2 Regression]|[3.4/4.0/4.1/4.2 Regression]
                   |-dM does not list all       |-dD does not list all
                   |defined macros (in          |defined macros (in
                   |particular, __STDC__)       |particular, __STDC__)


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



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

* [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dD does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (6 preceding siblings ...)
  2006-01-09 22:08 ` [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dD " pinskia at gcc dot gnu dot org
@ 2006-01-15 22:30 ` mmitchel at gcc dot gnu dot org
  2006-01-16 13:47 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-01-15 22:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from mmitchel at gcc dot gnu dot org  2006-01-15 22:30 -------
This is not critical, as it only affects secondary uses of the compiler.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dD does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (7 preceding siblings ...)
  2006-01-15 22:30 ` mmitchel at gcc dot gnu dot org
@ 2006-01-16 13:47 ` jakub at gcc dot gnu dot org
  2006-01-23 21:50 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-01-16 13:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2006-
                   |                            |01/msg00840.html
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-01-09 01:28:51         |2006-01-16 13:47:58
               date|                            |


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


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

* [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dD does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (8 preceding siblings ...)
  2006-01-16 13:47 ` jakub at gcc dot gnu dot org
@ 2006-01-23 21:50 ` jakub at gcc dot gnu dot org
  2006-01-23 21:51 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-01-23 21:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2006-01-23 21:50 -------
Subject: Bug 25717

Author: jakub
Date: Mon Jan 23 21:50:15 2006
New Revision: 110144

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110144
Log:
        PR preprocessor/25717
        * init.c (cpp_init_builtins): If __STDC__ will not change value
        between system headers and other sources, define it as a normal
        macro rather than a builtin.
        * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
        cpp_in_system_header condition.

Modified:
    trunk/libcpp/ChangeLog
    trunk/libcpp/init.c
    trunk/libcpp/macro.c


-- 


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


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

* [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dD does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (9 preceding siblings ...)
  2006-01-23 21:50 ` jakub at gcc dot gnu dot org
@ 2006-01-23 21:51 ` jakub at gcc dot gnu dot org
  2006-03-11  3:21 ` [Bug preprocessor/25717] [3.4/4.0 " mmitchel at gcc dot gnu dot org
  2007-02-03 16:11 ` [Bug preprocessor/25717] [4.0 " gdr at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-01-23 21:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jakub at gcc dot gnu dot org  2006-01-23 21:51 -------
Subject: Bug 25717

Author: jakub
Date: Mon Jan 23 21:51:10 2006
New Revision: 110145

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110145
Log:
        PR preprocessor/25717
        * init.c (cpp_init_builtins): If __STDC__ will not change value
        between system headers and other sources, define it as a normal
        macro rather than a builtin.
        * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
        cpp_in_system_header condition.

Modified:
    branches/gcc-4_1-branch/libcpp/ChangeLog
    branches/gcc-4_1-branch/libcpp/init.c
    branches/gcc-4_1-branch/libcpp/macro.c


-- 


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


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

* [Bug preprocessor/25717] [3.4/4.0 Regression] -dD does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (10 preceding siblings ...)
  2006-01-23 21:51 ` jakub at gcc dot gnu dot org
@ 2006-03-11  3:21 ` mmitchel at gcc dot gnu dot org
  2007-02-03 16:11 ` [Bug preprocessor/25717] [4.0 " gdr at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11  3:21 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

* [Bug preprocessor/25717] [4.0 Regression] -dD does not list all defined macros (in particular, __STDC__)
  2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
                   ` (11 preceding siblings ...)
  2006-03-11  3:21 ` [Bug preprocessor/25717] [3.4/4.0 " mmitchel at gcc dot gnu dot org
@ 2007-02-03 16:11 ` gdr at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 16:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from gdr at gcc dot gnu dot org  2007-02-03 16:10 -------
Fixed in GCC-4.1.0 and higher.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.0.4                       |4.1.0


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


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

end of thread, other threads:[~2007-02-03 16:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-08 22:51 [Bug preprocessor/25717] New: -dM does not list all defined macros (in particular, __STDC__) shaun4477 at gmail dot com
2006-01-09  0:27 ` [Bug preprocessor/25717] " pinskia at gcc dot gnu dot org
2006-01-09  1:28 ` pinskia at gcc dot gnu dot org
2006-01-09  1:30 ` pinskia at gcc dot gnu dot org
2006-01-09  1:31 ` [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-01-09 21:57 ` steven at gcc dot gnu dot org
2006-01-09 22:00 ` steven at gcc dot gnu dot org
2006-01-09 22:08 ` [Bug preprocessor/25717] [3.4/4.0/4.1/4.2 Regression] -dD " pinskia at gcc dot gnu dot org
2006-01-15 22:30 ` mmitchel at gcc dot gnu dot org
2006-01-16 13:47 ` jakub at gcc dot gnu dot org
2006-01-23 21:50 ` jakub at gcc dot gnu dot org
2006-01-23 21:51 ` jakub at gcc dot gnu dot org
2006-03-11  3:21 ` [Bug preprocessor/25717] [3.4/4.0 " mmitchel at gcc dot gnu dot org
2007-02-03 16:11 ` [Bug preprocessor/25717] [4.0 " gdr 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).