Commit 0d3e9f35 by Steven Bosscher Committed by Steven Bosscher

re PR preprocessor/19309 (Wrong documentation of predefined __GNUC__ with cpp invocation)

	PR documentation/19309
	* doc/cpp.texi: The __GNUC__ and related predefined macros
	are also defined for the "standalone" cpp.
	Some non-GCC compilers may also define __GNUC__.

From-SVN: r94805
parent ccf7f880
2005-02-10 Steven Bosscher <stevenb@suse.de>
PR documentation/19309
* doc/cpp.texi: The __GNUC__ and related predefined macros
are also defined for the "standalone" cpp.
Some non-GCC compilers may also define __GNUC__.
2005-02-10 Jakub Jelinek <jakub@redhat.com> 2005-02-10 Jakub Jelinek <jakub@redhat.com>
PR c/19342 PR c/19342
......
...@@ -1927,16 +1927,16 @@ These macros are defined by all GNU compilers that use the C ...@@ -1927,16 +1927,16 @@ These macros are defined by all GNU compilers that use the C
preprocessor: C, C++, and Objective-C@. Their values are the major preprocessor: C, C++, and Objective-C@. Their values are the major
version, minor version, and patch level of the compiler, as integer version, minor version, and patch level of the compiler, as integer
constants. For example, GCC 3.2.1 will define @code{__GNUC__} to 3, constants. For example, GCC 3.2.1 will define @code{__GNUC__} to 3,
@code{__GNUC_MINOR__} to 2, and @code{__GNUC_PATCHLEVEL__} to 1. They @code{__GNUC_MINOR__} to 2, and @code{__GNUC_PATCHLEVEL__} to 1. These
are defined only when the entire compiler is in use; if you invoke the macros are also defined if you invoke the preprocessor directly.
preprocessor directly, they are not defined.
@code{__GNUC_PATCHLEVEL__} is new to GCC 3.0; it is also present in the @code{__GNUC_PATCHLEVEL__} is new to GCC 3.0; it is also present in the
widely-used development snapshots leading up to 3.0 (which identify widely-used development snapshots leading up to 3.0 (which identify
themselves as GCC 2.96 or 2.97, depending on which snapshot you have). themselves as GCC 2.96 or 2.97, depending on which snapshot you have).
If all you need to know is whether or not your program is being compiled If all you need to know is whether or not your program is being compiled
by GCC, you can simply test @code{__GNUC__}. If you need to write code by GCC, or a non-GCC compiler that claims to accept the GNU C dialects,
you can simply test @code{__GNUC__}. If you need to write code
which depends on a specific version, you must be more careful. Each which depends on a specific version, you must be more careful. Each
time the minor version is increased, the patch level is reset to zero; time the minor version is increased, the patch level is reset to zero;
each time the major version is increased (which happens rarely), the each time the major version is increased (which happens rarely), the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment