This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/81745] missing warning with -pedantic when a C file does not end with a newline character
- From: "vincent-gcc at vinc17 dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 07 Aug 2017 00:33:40 +0000
- Subject: [Bug preprocessor/81745] missing warning with -pedantic when a C file does not end with a newline character
- Auto-submitted: auto-generated
- References: <bug-81745-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81745
--- Comment #6 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
(In reply to Andrew Pinski from comment #5)
> Also see http://www.opengroup.org/austin/aardvark/latest/xcubug2.txt
> ERN 76
This is not about the missing newline at the end of a file.
Moreover, GCC doesn't seem to be consistent:
$ printf 'int main(void) { return 0; } \\' | gcc -xc -std=c99 - && echo OK
<stdin>:1:30: error: stray ‘\’ in program
$ printf 'int main(void) { return 0; } \\\n' | gcc -xc -std=c99 - && echo OK
<stdin>:1:30: warning: backslash-newline at end of file
OK
$