This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/41540] New: -dM -E doesn't #define __FILE__


The documentation for the -dM -E option states that

  "Instead of the normal output, generate a list of `#define' directives for
  all the macros defined during the execution of the preprocessor, including
  predefined macros. This gives you a way of finding out what is predefined
  in your version of the preprocessor."

but the predefined standard macro __FILE__ does not appear in the output
(and neither does __LINE__):

$ echo >t.c && gcc -dM -E t.c | grep __FILE__ || echo "__FILE__ not #defined"
__FILE__ not #defined
$ 

I believe __FILE__ should always appear in the output.

Since __LINE__ changes its value from line to line it should either be
documented as not being output at all or, perhaps preferably, it should
be output with the value of 0.


-- 
           Summary: -dM -E doesn't #define __FILE__
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: msebor at gmail dot com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]