[Bug preprocessor/59805] New: invalid preprocessing directive not diagnosed with assembler-with-cpp
aldot at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 14 14:04:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59805
Bug ID: 59805
Summary: invalid preprocessing directive not diagnosed with
assembler-with-cpp
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: aldot at gcc dot gnu.org
CC: tromey at redhat dot com
-x assembler-with-cpp remains silent instead of emitting some kind of
diagnostics.
$ cat libcpp-bug.c
# INCLUDE <./does-not-exist.HHH>
# HUH <./does-not-exist.HHH>
$ gcc -x assembler-with-cpp -o xxx.o -c libcpp-bug.c -W -Wall -pedantic -Wextra
Properly diagnosed with c or c-header:
$ gcc -x c -o xxx.o -c libcpp-bug.c -W -Wall -pedantic -Wextra
libcpp-bug.c:1:3: error: invalid preprocessing directive #INCLUDE
# INCLUDE <./does-not-exist.HHH>
^
libcpp-bug.c:2:3: error: invalid preprocessing directive #HUH
# HUH <./does-not-exist.HHH>
^
libcpp-bug.c:2:0: warning: ISO C forbids an empty translation unit [-Wpedantic]
# HUH <./does-not-exist.HHH>
^
gcc-4.9-trunk@206144
Since the #INCLUDE was not processed this missing diagnostics resulted in wrong
code generated, but adding that keyword.
Didn't look if this is a driver bug.
More information about the Gcc-bugs
mailing list