Search code examples
gccwarningscompiler-flags

What flag silences GCC's warning about no newline at file-endings?


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.


Solution

  • 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