12

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?

a06e
  • 18,594
  • 33
  • 93
  • 169
  • 1
    related/dupe: http://stackoverflow.com/questions/30286000/change-default-cmakelists-txt-in-clion-to-include-warnings – NathanOliver Aug 03 '15 at 15:08

3 Answers3

16

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?

Community
  • 1
  • 1
Gluttton
  • 5,739
  • 3
  • 31
  • 58
5

For C:

set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
1

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.

Mark Jansen
  • 1,491
  • 12
  • 24
  • 4
    Doesn't work. I don't see anything. CLion only prints a percentage log of the files it has compiled so far. – a06e Aug 03 '15 at 15:03