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:40: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 #7 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
And with only the preprocessor:
$ printf 'int main(void) { return 0; } \\' | gcc -E -
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "<stdin>"
int main(void) { return 0; } \
$ printf 'int main(void) { return 0; } \\\n' | gcc -E -
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "<stdin>"
<stdin>:1:30: warning: backslash-newline at end of file
int main(void) { return 0; }
$
Here one gets two different results!