This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Remove -Wtraditional cruft from gengtype-lex.l
- From: Kelley Cook <kcook34 at ford dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 07 Oct 2003 15:52:28 -0400
- Subject: Remove -Wtraditional cruft from gengtype-lex.l
- Hop-count: 1
- Reply-to: Kelley Cook <kelleycook at wideopenwest dot com>
The patch http://gcc.gnu.org/ml/gcc-patches/2002-07/msg01291.html from
Kaveh Ghazi was added in order to bootstrap with -Wtraditional -Werror.
This essentially reverts it, which removes a plethora of warnings when
bootstrapping with -Wold-style-definition.
Since the parsedir changes modified the Makefile rule after Kaveh's
patch, I patterned this gengtype-lex.c rule after the rule for
gengtype-yacc.c.
Bootstrapped both with flex 2.5.4a and flex 2.5.31 (which is available
from http://lex.sourceforge.net/) along with "-Wold-style-definition" on
i686-pc-cygwin
For good measure, I bootstrapped after changing parsedir=$(objdir) which
also worked as expected.
The generated files from ./gengtype remained unchanged before and after
the patch.
OK to install?
Kelley Cook
2003-10-07 Kelley Cook <kcook@gcc.gnu.org>
* gengtype-lex.l: Remove -Wtraditional cruft.
* Makefile.in (gengtype-lex.c): Ditto.
--- gengtype-lex.l.orig 2003-10-07 14:15:29.395924800 -0400
+++ gengtype-lex.l 2003-10-07 14:20:21.716260800 -0400
@@ -30,9 +30,6 @@
#include "gengtype.h"
#include "gengtype-yacc.h"
-#undef YY_USE_PROTOS
-#define YY_DECL int yylex ()
-
static void update_lineno (const char *l, size_t len);
struct fileloc lexer_line;
--- Makefile.in.orig 2003-10-07 15:23:14.451187200 -0400
+++ Makefile.in 2003-10-07 15:27:23.739646400 -0400
@@ -2203,11 +2203,8 @@
$(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
$(parsedir)/gengtype-yacc.c $(OUTPUT_OPTION)
-# The sed command works around a bug in flex-2.5.4.
$(parsedir)/gengtype-lex.c : $(srcdir)/gengtype-lex.l
- $(FLEX) $(FLEXFLAGS) -t -o- $(srcdir)/gengtype-lex.l | \
- sed 's/^\(char msg\[\];\)/yyconst \1/' > g-$$$$ ; \
- if test $$? -eq 0 ; then \
+ if $(FLEX) $(FLEXFLAGS) -o g-$$$$ $(srcdir)/gengtype-lex.l; then \
mv -f g-$$$$ $(parsedir)/gengtype-lex.c ; \
else \
rm -f g-$$$$ ; \