This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: What is the purpose of 'warning: no newline at end of file'?
- From: "Neo Anderson" <neo_in_matrix at msn dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 06 Jul 2005 18:16:46 -1000
- Subject: Re: What is the purpose of 'warning: no newline at end of file'?
- Bcc:
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