This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/19309] New: Wrong documentation of predefined __GNUC__ with cpp invocation
- From: "dannysmith at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jan 2005 10:45:39 -0000
- Subject: [Bug preprocessor/19309] New: Wrong documentation of predefined __GNUC__ with cpp invocation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi,
According to documentation of preprocessor (cpp.texi:1934)
the predefined macros
__GNUC__
__GNUC_MINOR__
__GNUC_PATCHLEVEL__
"are defined only when the entire compiler is in use; if you invoke the
preprocessor directly, they are not defined."
But,
> touch foo.c
> cpp -dM -E foo.c | grep GNUC
produces
#define __GNUC_PATCHLEVEL__ 0
#define __GNUC__ 4
#define __GNUC_MINOR__ 0
Same behaviour is observed on 3.4.4.
Macros are also defined with cpp -traditional-cpp.
Should the documentation be modified?
Or is there any reason _not_ to define __GNUC__ when invoking cpp.
Danny
--
Summary: Wrong documentation of predefined __GNUC__ with cpp
invocation
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dannysmith at users dot sourceforge dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-mingw32
GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19309