Is it a good idea to eliminate compiler warnings?

前端 未结 14 2706
既然无缘
既然无缘 2021-02-19 01:00

In the past I\'ve worked with -Wall and other switches for gcc to eliminate every compiler warning for projects I\'ve been involved in. Similarly, in Perl, I always program wit

14条回答
  •  醉酒成梦
    2021-02-19 01:39

    Eclipse, IntelliJ and other modern code quality systems have huge numbers of available warnings.

    Cleaning up warnings is a useful practice, if for no other reason than to quiet down the noise. Your code probably already has some of these that are real bugs.

    However, many of the warnings are probably bogus. Some warnings from Eclipse are things like micro-optimizations or stylistic nitpicking. This means that some of your cleanups must be tweaking the settings of your tool, rather than code changes or localized suppression directives.

提交回复
热议问题