aboutsummaryrefslogtreecommitdiff
path: root/gdb/Makefile.in
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-06-17 23:17:00 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-06-17 23:17:00 +0200
commitcf0dd6f02cd45d6dbb6bd87dde25dd3ed74eb7d0 (patch)
tree8e9d7226b47d9a6c815fcd204b9c8ee3c9d68c49 /gdb/Makefile.in
parent291e62953900e0f4998224127bc56239e421cda9 (diff)
gdb: Pass -x c++ to the compiler
Because we are compiling .c files containing C++ code, clang++ complains with: clang: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated If renaming all the source files to .cpp is out of the question, an alternative is to pass "-x c++" to convince the compiler that we are really compiling C++. It works fine with GCC too. gdb/ChangeLog: * Makefile.in (COMPILE.pre): Add "-x c++". gdb/gdbserver/ChangeLog: * Makefile.in (COMPILE.pre): Add "-x c++".
Diffstat (limited to 'gdb/Makefile.in')
-rw-r--r--gdb/Makefile.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 5e5fcaae7a..153a5dd6fb 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -114,7 +114,7 @@ depcomp = $(SHELL) $(srcdir)/../depcomp
# Note that these are overridden by GNU make-specific code below if
# GNU make is used. The overrides implement dependency tracking.
-COMPILE.pre = $(CXX) $(CXX_DIALECT)
+COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
COMPILE.post = -c -o $@
COMPILE = $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
POSTCOMPILE = @true