For my Linux applications, I like to embed compiler information into the executables. For the Intel compiler, the __INTEL_COMPILER and __INTEL_COMPILER_UPDATE pre-processor macros give me what I want. However, I also like to embed the GNU compatibility information, too. __GNUC__ and __GNU_MINOR__ give me accurate information, but __GNUC_PATCHLEVEL__, while defined, does not contain the correct value.
For example, when using icpc 18.104.22.168 with g++ 4.8.2, __GNUC__ is set to 4, __GNUC_MINOR__ is set to 8, but __GNUC_PATCHLEVEL__ is set to 0. I was expecting 2, and I would really like to get the correct version without making a system call.
Is this a bug, an unsupported feature, or am I doing something wrong?