GCC


[Home] Home > Programming > Preprocessor > Compilers >
GCC

Description

The GNU Compiler Collection.


Macros

Type Macro Description
Identification __GNUC__
Version __GNUC__ Version
Version __GNUC_MINOR__ Revision
Version __GNUC_PATCHLEVEL__ Patch (introduced in version 3.0)

Examples

Version __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__
2.5.x 2 N/A N/A
2.7.x 2 7 N/A
3.0.2 3 0 2

Notes

Notice that the meaning of the __GNUC__ macro has changed subtly over the years, from identifying the GNU C/C++ compiler to identifying any compiler that implements the GNU compiler extensions (see the Feature request - a macro defined for GCC discussion for further information).

For example, the Intel C++ on Linux also defines these macros from version 8.1 (see the Intel C++ Compiler 8.1 for Linux Release Notes and Intel Compilers for Linux: Compatibility with GNU Compilers.)


Copyright © 2010-2024 Paul Ward.
License Information