C / C++ compiler warnings: do you clean up all your code to remove them or leave them in?

前端 未结 18 2362
夕颜
夕颜 2020-12-24 00:08

I\'ve worked on many projects where I\'ve been given code by others to update. More often than not I compile it and get about 1,000+ compiler warnings. When I see compiler w

18条回答
  •  被撕碎了的回忆
    2020-12-24 00:45

    Always clean up your warnings. If you have a specific case where you know the warning is ok, then suppress it for that instance only.

    While some warnings can be benign, most signify a real problem with the code.

    If you don't clean up all of your warnings then the warning list will continue to grow and the real problem cases will be lost in a sea of warning noise.

提交回复
热议问题