How to enable all compiler warnings in CLion?

不羁岁月 提交于 2019-12-05 05:15:29
Gluttton

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?

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.

For C:

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