Why should I always enable compiler warnings?

后端 未结 20 1619
时光说笑
时光说笑 2020-11-22 00:28

I often hear that when compiling C and C++ programs I should \"always enable compiler warnings\". Why is this necessary? How do I do that?

Sometimes I also hear tha

20条回答
  •  逝去的感伤
    2020-11-22 00:48

    Take it easy: you don't have to, it is not necessary. -Wall and -Werror was designed by code-refactoring maniacs for themselves: it was invented by compiler developers to avoid breaking existing builds after compiler or programming language updates on the user side. The feature is nothing, but all about the decision to break or not to break the build.

    It is totally up to your preference to use it or not. I use it all the time because it helps me to fix my mistakes.

提交回复
热议问题