This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] 'make check-headers' for c++ header
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 13 Jan 2017 14:41:09 -0000
- Subject: [binutils-gdb] 'make check-headers' for c++ header
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e4241ace685d9886c14f1362e1e1783129774b7c
commit e4241ace685d9886c14f1362e1e1783129774b7c
Author: Yao Qi <yao.qi@linaro.org>
Date: Fri Jan 13 14:40:11 2017 +0000
'make check-headers' for c++ header
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".
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/Makefile.in | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bf0930f..dde53bd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index ae5a80e..3ce7d69 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -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