Sign in to follow this  
neverland

annoying warning message from g++ compiler

Recommended Posts

Hello all I've just upgraded my g++ compiler to 3.3.3 on Cygwin. But there is always a annoying warnig message "no new line at end of file" no matter what code you writes. How to get rid of that warnig message ?

Share this post


Link to post
Share on other sites
maybe just maybe, with a newline at the end of the file. that is a blank line. so in your last code line just press enter once, et voila the warning is gone. btw ever tried to compile with -Wall? have fun :)

Share this post


Link to post
Share on other sites
For the ultimate in useless warnings, compile with -Wall -W -Werror -pedantic-errors -Wfloat-equal -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wredundant-decls -Wunreachable-code -Winline -Wold-style-cast -Woverloaded-virtual -Wsign-promo -Weffc++ -O3

So anal, even

#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;

return 0;
}


won't compile.

If you're actually seriously want lots of warnings, then remove -Weffc++ and -Wunreachable-code from above options so that the standard template library will continue to function as intended.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this