Generating an error if checked boolean macro is not defined

后端 未结 5 1055
后悔当初
后悔当初 2020-12-16 12:25

I have several configuration files each one containing the definition of some boolean macro, to be set to 0 or 1. Then, in my code, I check the value of such a macro to deci

5条回答
  •  [愿得一人]
    2020-12-16 12:44

    What about using the -Wundef gcc preprocessor option? This will only generate a warning, which can easily be turned to an error with -Werror=undef.

提交回复
热议问题