This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: error: "no newline at end of file"
Florian Weimer <fw@deneb.enyo.de> writes:
| * Manuel López-Ibáñez:
|
| > C++ preprocessor emits errors by default for nonconformant code,
| > following the C++ frot-end default behaviour.
|
| Neither the C standard nor the C++ standard imposes any requirements
| on concrete source code representation, so it's not quite right to
| blame this issue on nonconformant code.
I don't understand your statement. The C++ (and the C) standard says
# 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.
The GNU preprocessor has chosen to diagnose that for ages.
Why is that an issue now?
-- Gaby