This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/41540] New: -dM -E doesn't #define __FILE__
- From: "msebor at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Oct 2009 22:08:05 -0000
- Subject: [Bug preprocessor/41540] New: -dM -E doesn't #define __FILE__
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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