[01/10] 'make check-headers' for c++ header

Message ID 1483712340-9157-1-git-send-email-yao.qi@linaro.org
State New, archived
Headers

Commit Message

Yao Qi Jan. 6, 2017, 2:18 p.m. UTC
  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.

The rest of 9 patches are obvious, and I'll push them in.

gdb:

2017-01-06  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/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Yao Qi Jan. 13, 2017, 2:41 p.m. UTC | #1
On 17-01-06 14:18:51, Yao Qi wrote:
> gdb:
> 
> 2017-01-06  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".

I pushed it in.
  

Patch

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