什么标志使GCC的文件结尾没有换行符的警告声音沉默? [英] What flag silences GCC's warning about no newline at file-endings?

查看:164
本文介绍了什么标志使GCC的文件结尾没有换行符的警告声音沉默?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚阅读了这篇文章,但是坦率地说,我的团队有几个人在不同的平台上工作,有几个不同的编辑人员(每个人都使用最好的套件),所以警告已经无处不在,并且它并不是一个值得关注的警告成为噪音,并使寻找严重警告麻烦。

很多时候重要的警告都没有被注意到,因为人们习惯了大量无用的警告通过,所以他们显然只是小心翼翼地停止看着他们,并且有理由恕我直言。我们可以说在我们的情况下,海湾合作委员会为了让任何人认真对待这个问题而哭得狼狈不堪,这是一种不良的态度,而是它的人性。

现在我们使用 -Wall 进行编译,因为我们需要警告,但是有一个计数器标志来避免新的警告?



注意:我仔细看了一下手册,但没有在任何地方找到明显的答案,所以我给了注意:为了回应Robert Gamble完全合理的解决方案,我们的代码是跨平台的,我们拥有人员并构建在Linux上, Solaris和Windows,所以新的......没有达成共识。而有人的编译器总是会哭泣。因为有超过40位开发人员和其他非程序员人员。

,我已经使用了GCC多年。



更新:
C ++ 11标准不应引发任何警告。 相关问答


I just read this post about why new-line warnings exist, but to be honest my team has people working on several different platforms and with several different editors (everyone uses what bests suites them), so the warning has become ubiquitous, and since its not really a warning worth taking care of it's become noise and makes finding serious warnings a hassle.

Many times important warnings have gone unnoticed because, people got used to having a gazillion useless warnings pass by, so they obviously just stop looking at them carefully, and with reason IMHO. One could say in our case GCC is crying wolf too much for anyone to take it seriously anymore, which is a bad attitude but its just human nature.

Right now we compile with -Wall, because we want warnings, but is there a counter flag to avoid the new-line warnings?

Note: I Looked through the manual a bit but didn't find the answer in any place obvious so I gave up.

Note: In response to Robert Gamble's totally reasonable solution, our code is cross-platform and we have people and builds on Linux, Solaris and Windows, so the new-line... is not under consensus. And Somebody's compiler is always going to cry-wolf. Because there are over 40 developers, and other non programmer staff as well.

解决方案

There isn't one as far as i know, i've used GCC for years.

Update: There should not be any warnings raised with C++11 standard. Related Q

这篇关于什么标志使GCC的文件结尾没有换行符的警告声音沉默?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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