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