How to enable all compiler warnings in CLion?

时光毁灭记忆、已成空白 提交于 2019-12-07 01:00:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!