'make check-headers' for c++ header
authorYao Qi <yao.qi@linaro.org>
Fri, 13 Jan 2017 14:40:11 +0000 (14:40 +0000)
committerYao Qi <yao.qi@linaro.org>
Fri, 13 Jan 2017 14:40:11 +0000 (14:40 +0000)
If I run 'make check-headers', I get these errors,
....
In file included from ../../binutils-gdb/gdb/common/common-defs.h:78:0,
                 from ../../binutils-gdb/gdb/defs.h:28,
                 from <command-line>:0:
../../binutils-gdb/gdb/common/common-utils.h:23:18: fatal error: string: No such file or directory
 #include <string>
                  ^

because we still parse headers as c file with a c compiler, which is no
longer true after we moved to C++.  This patch changes it to use C++
compiler and parse headers as c++ headers.

gdb:

2017-01-13  Yao Qi  <yao.qi@linaro.org>

* Makefile.in (checker-headers): Use CXX and CXX_DIALET instead
of CC.  Pass "-x c++-header" instead of "-x c".

gdb/ChangeLog
gdb/Makefile.in

index bf0930fa62f34b67ee326d35ac41b29325239954..dde53bd91aef4301a604f53a6d312565100fa12a 100644 (file)
@@ -1,3 +1,8 @@
+2017-01-13  Yao Qi  <yao.qi@linaro.org>
+
+       * Makefile.in (checker-headers): Use CXX and CXX_DIALET instead
+       of CC.  Pass "-x c++-header" instead of "-x c".
+
 2017-01-12  Simon Marchi  <simon.marchi@ericsson.com>
 
        * remote.c (remote_can_async_p): Update comment.
index ae5a80e7c82d76e7bc839f3793772ff15bff3e69..3ce7d69a049b7be85519c6143fa66f41c7b16515 100644 (file)
@@ -1988,8 +1988,8 @@ CHECK_HEADERS = $(HFILES_NO_SRCDIR)
 check-headers:
        @echo Checking headers.
        for i in $(CHECK_HEADERS) ; do \
-               $(CC) -x c -c -fsyntax-only $(INTERNAL_CFLAGS) \
-                       -include defs.h $(srcdir)/$$i ; \
+               $(CXX) $(CXX_DIALECT) -x c++-header -c -fsyntax-only \
+               $(INTERNAL_CFLAGS) -include defs.h $(srcdir)/$$i ; \
        done
 .PHONY: check-headers
 
This page took 0.027507 seconds and 4 git commands to generate.