c++g++

"-D__STDC_FORMAT_MACROS" gnu compiler option


I am cleaning up my Makefile and try to understand what is actually happening there. I came across said option. It must enable some macros to guarantee compatibility with older C libraries, but i could not find its purpose. What does the gnu compiler (g++) option

g++ -D__STDC_FORMAT_MACROS

mean or do? Is it even necessary for g++?

PS: Im working under Linux


Solution

  • Thanks to the link of Nick, I conclude that it is not required for g++. It has to do with C's inttype.h and printf. From the link

    In particular, the symbol __STDC_FORMAT_MACROS, mentioned in footnote 182 of the C standard, plays no role in C++.