[3/4] Simplify ada-exp.o rule

Message ID 20180903190359.12817-4-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Sept. 3, 2018, 7:03 p.m. UTC
  The ada-exp.o rule no longer needs to pass -Wno-old-style-definition
to the compiler, as this option has no meaning in C++.  So, This patch
simplifies the explicit ada-exp.o rule in the Makefile.  The rule is
still needed because, according to the comment, ada-exp.c may appear
in the srcdir.

gdb/ChangeLog
2018-09-03  Tom Tromey  <tom@tromey.com>

	* Makefile.in (GDB_WARN_CFLAGS_NO_DEFS): Remove.
	(ada-exp.o): Update.
---
 gdb/ChangeLog   | 5 +++++
 gdb/Makefile.in | 8 +-------
 2 files changed, 6 insertions(+), 7 deletions(-)
  

Comments

Joel Brobecker Sept. 4, 2018, 7:58 a.m. UTC | #1
> The ada-exp.o rule no longer needs to pass -Wno-old-style-definition
> to the compiler, as this option has no meaning in C++.  So, This patch
> simplifies the explicit ada-exp.o rule in the Makefile.  The rule is
> still needed because, according to the comment, ada-exp.c may appear
> in the srcdir.

For the record, this is correct; in particular, the source packages
we produce (nightly and releases) include them. I believe this helps
avoid a dependency on bison (and flex for ada-lex.[lc]) for users
building from source packages rather than from git sources.
  

Patch

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 16aac9dadf2..c76a4e4394c 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -199,9 +199,6 @@  WERROR_CFLAGS = @WERROR_CFLAGS@
 GDB_WARN_CFLAGS = $(WARN_CFLAGS)
 GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
 
-GDB_WARN_CFLAGS_NO_DEFS = `echo " $(GDB_WARN_CFLAGS) " \
-		   | sed "s/ -Wold-style-definition / -Wno-old-style-definition /g"`
-
 RDYNAMIC = @RDYNAMIC@
 
 # Where is the INTL library?  Typically in ../intl.
@@ -2385,11 +2382,8 @@  ALLDEPFILES = \
 # development builds.
 ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
 
-# Some versions of flex give output that triggers
-# -Wold-style-definition.
 ada-exp.o: ada-exp.c
-	$(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) \
-		$(GDB_WARN_CFLAGS_NO_DEFS) $(COMPILE.post) $(ADA_EXP_C)
+	$(COMPILE) $(ADA_EXP_C)
 	$(POSTCOMPILE)
 
 # Message files.  Based on code in gcc/Makefile.in.