This is the mail archive of the
mailing list for the GCC project.
Re: wny does GCC warn about "no newline at end of file"?
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Jonathan Wilson <jonwil at tpgi dot com dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 29 Nov 2003 20:53:04 -0800
- Subject: Re: wny does GCC warn about "no newline at end of file"?
- References: <3FC97371.email@example.com>
Jonathan Wilson wrote:
Is there a reason for this?
The C language standard says
A source file that is not empty shall end in a new-line character, which
shall not be immediately preceded by a backslash character.
Since this is a "shall" clause, we must emit a diagnostic message for a
violation of this rule.
This is in section 188.8.131.52 of the ANSI C 1989 standard. Section 184.108.40.206
of the ISO C 1999 standard (and probably also the ISO C 1990 standard).
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com