GCC dump preprocessor defines

后端 未结 6 2149
既然无缘
既然无缘 2020-11-22 14:28

Is there a way for gcc/g++ to dump its preprocessor defines from the command line? I mean things like __GNUC__, __STDC__, and so on.

6条回答
  •  失恋的感觉
    2020-11-22 15:22

    While working in a big project which has complex build system and where it is hard to get (or modify) the gcc/g++ command directly there is another way to see the result of macro expansion. Simply redefine the macro, and you will get output similiar to following:

    file.h: note: this is the location of the previous definition
    #define MACRO current_value
    

提交回复
热议问题