2
自从我加入了这个项目,我的编译输出一直期待这样的:寻找问题的宏观
[ 0%] Building CXX object lib-tests/gmock/CMakeFiles/gmock_main.dir/gtest/src/gtest-all.cc.o
<command-line>:0:23: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:20: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:23: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:20: warning: ISO C99 requires whitespace after the macro name
[ 0%] Building CXX object lib-tests/gmock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.o
<command-line>:0:23: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:20: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:23: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:20: warning: ISO C99 requires whitespace after the macro name
[ 0%] Building CXX object lib-tests/gmock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.o
<command-line>:0:23: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:20: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:23: warning: ISO C99 requires whitespace after the macro name
<command-line>:0:20: warning: ISO C99 requires whitespace after the macro name
[ 0%] Linking CXX static library libgmock_main.a
[ 0%] Built target gmock_main
等。整个项目编译的每个文件之间始终存在高达100%的警告。这只是编译的开始,它从谷歌测试库开始,但我并不特别怀疑它是不良宏的来源。 (但它可能)这很奇怪,因为当我谷歌这个警告,人们得到了代码和宏的快照,但我的编译器不这样做,我只是得到警告。
我在Debian上使用gion编译器和cmake的CLion。我已经尝试了多个正则表达式来查找没有空格的宏,但没有找到任何成功。我应该怎么做才能确定产生此警告的宏?
通过逐步评论(或者用一些'#error')来评估有问题的标题? – Jarod42
您可以将编译器输出设置为verbose并查看该宏是否将打印到构建日志中的某个位置? –
你的命令行看起来像什么?可能有一些奇怪的“-Dxxx”。 – stefan