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

Jonathan Turkanis technews@kangaroologic.com
Thu Jul 7 03:40:00 GMT 2005


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



More information about the Gcc-help mailing list