C / C ++编译器警告:你清理所有code删除它们,或让他们吗? [英] C / C++ compiler warnings: do you clean up all your code to remove them or leave them in?

查看:122
本文介绍了C / C ++编译器警告:你清理所有code删除它们,或让他们吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在哪里,我一直给code。通过别人来更新许多项目的工作。更多的往往不是我编译它,并获取有关1000 +编译器警告。当我看到编译器警告他们让我觉得脏,所以我的第一个任务是清理code和删除它们。通常情况下,我觉得大概有十几问题,像未初始化的变量,例如

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 warnings they make me feel dirty, so my first task is to clean up the code and remove them all. Typically I find about a dozen problems like uninitialized variables such.

我不明白为什么人们离开他们并没有完全干净的编译没有警告。我缺少的东西吗?没有任何正当理由,只是离开他们?任何恐怖故事分享?

I don't understand why people leave them in and don't have perfectly clean compiles with no warnings. Am I missing something? Is there any valid reason to just leave them? Any horror stories to share?

推荐答案

我要清理任何警告。
即使你知道是无害的(如果这样的事情存在的话)的人会给你一个坏的IM pression到谁就将编译code。

I would clean up any warning. Even the ones that you know are harmless (if such a thing exists) will give a bad impression of you to whoever will compile the code.

它的臭的招牌我会找,如果我不得不在别人code的工作之一。

It one of the "smelly" signs I would look for if I had to work on someone else code.

如果不是真正的错误或将来潜在的问题,那将是草率的标志

If not real errors or potential future issues, it would be a sign of sloppiness

这篇关于C / C ++编译器警告:你清理所有code删除它们,或让他们吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆