问题
I want to see all compiler warnings in CLion. I don't want them treated as errors, but I want to inspect all of them.
How can I do this?
回答1:
Try to set compiler flag in CMakeLists.txt
:
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
Related question: How to enable C++11 in CLion?
回答2:
For C:
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
回答3:
Rebuild your entire project. Most compilers don't rebuild every file when you just press build, so you will only see warnings from files that were changed.
来源:https://stackoverflow.com/questions/31790467/how-to-enable-all-compiler-warnings-in-clion