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?

becko
  • 15,722
  • 27
  • 80
  • 155
  • 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,473
  • 2
  • 30
  • 55
5

For C:

set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
snr
  • 16,197
  • 2
  • 61
  • 88
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,462
  • 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. – becko Aug 03 '15 at 15:03