error: "no newline at end of file"

Gabriel Dos Reis gdr@cs.tamu.edu
Tue Mar 27 16:30:00 GMT 2007


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



More information about the Gcc mailing list