In article <11**********************@g44g2000cwa.googlegroups .com>,
Weasel <We********@gmail.com> wrote:
This occured right after i tryed to compile the file
hello.cpp:9:2: warning: no newline at end of file
Comeau, in strict mode, gives:
error: last line of file ends without a newline
In other modes it might just be a warning.
In C mode, the diagnostic can be removed.
As both these compilers are saying, source files should
end with a newline. The C++ Standard says in 2.1p2:
"If a source file that is not empty does not end in a new-line
character, or ends in a new-line character immediately
preceded by a backslash character, the behavior is undefined."
C99 5.1.1.2p2 reads:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character
before any such splicing takes place."
This normally occurs as a result of a text editor that does not
put out a trailing NL in a text file. It may also indicate that
somehow the rest of a file got tossed, though that would also
normally give some other errors if it got cut off so abruptly.
--
Greg Comeau / Celebrating 20 years of Comeauity!
Comeau C/C++ ONLINE ==>
http://www.comeaucomputing.com/tryitout
World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
Comeau C/C++ with Dinkumware's Libraries... Have you tried it?