This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/81745] missing warning with -pedantic when a C file does not end with a newline character


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!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]