This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What is the purpose of 'warning: no newline at end of file'?


So, what is the purpose of this warning? What possible 'damages' does this warning protect against?


And, what is the 'the behavior'?


----Original Message Follows----
From: Jonathan Turkanis <technews@kangaroologic.com>
To: gcc-help@gcc.gnu.org
Subject: Re: What is the purpose of 'warning: no newline at end of file'?
Date: Wed, 06 Jul 2005 21:41:20 -0600

Neo Anderson wrote:
I don't even think it's a problem. Why do I need (or better have) a line ending?

The C++ standard says: If a source file that is not empty does not end in a newline character, or ends in a newline character immediately preceded by a backslash character, the behavior is undefined. (2.1/1)


Jonathan



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]