This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for ISO C function definition warnings from gengtype-lex.c


I haven't yet been able to get a new version of flex which fixes the
warnings in gcc so this patch implements option 4 from this
discussion: http://gcc.gnu.org/ml/gcc/2002-07/msg00138.html

It eliminates the "ISO C function definitions" warnings from
gengtype-lex.c.

Bootstraps on solaris2 still die late in stage2 for unrelated reasons,
but it got far enough that I can see the patch works.  Assuming full
bootstrap succeeds when the unrelated bug is fixed, ok to install?

		Thanks,
		--Kaveh


2002-07-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* Makefile.in (gengtype-lex.c): Work around a bug in flex.
	* gengtype-lex.l (YY_USE_PROTOS): Undef.
	(YY_DECL): Define.
	
diff -rup orig/egcc-CVS20020704/gcc/Makefile.in egcc-CVS20020704/gcc/Makefile.in
--- orig/egcc-CVS20020704/gcc/Makefile.in	2002-07-01 16:00:19.000000000 -0400
+++ egcc-CVS20020704/gcc/Makefile.in	2002-07-04 09:28:50.844683449 -0400
@@ -1989,9 +1989,17 @@ gengtype-yacc.o : gengtype-yacc.c gengty
 	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
 	  $(srcdir)/gengtype-yacc.c $(OUTPUT_OPTION)
 
+# The sed command works around a bug in flex-2.5.4.
 $(srcdir)/gengtype-lex.c : $(srcdir)/gengtype-lex.l
-	$(FLEX) $(FLEXFLAGS) -o$@ $(srcdir)/gengtype-lex.l \
-	 || ( rm -f $@ && false )
+	cd $(srcdir) && \
+	$(FLEX) $(FLEXFLAGS) -t -o$@ $(srcdir)/gengtype-lex.l | \
+	  sed 's/^\(char msg\[\];\)/yyconst \1/' > g-$$$$ ; \
+	if test $$? -eq 0 ; then \
+	  mv -f g-$$$$ gengtype-lex.c ; \
+	else \
+	  rm -f g-$$$$.* ; \
+	  false ; \
+	fi
 
 $(srcdir)/gengtype-yacc.c: $(srcdir)/gengtype-yacc.y
 	(cd $(srcdir) && \
diff -rup orig/egcc-CVS20020704/gcc/gengtype-lex.l egcc-CVS20020704/gcc/gengtype-lex.l
--- orig/egcc-CVS20020704/gcc/gengtype-lex.l	2002-06-08 22:37:45.000000000 -0400
+++ egcc-CVS20020704/gcc/gengtype-lex.l	2002-07-04 09:05:49.880702781 -0400
@@ -28,6 +28,9 @@ Software Foundation, 59 Temple Place - S
 #include "gengtype.h"
 #include "gengtype-yacc.h"
 
+#undef YY_USE_PROTOS
+#define YY_DECL int yylex ()
+
 static void update_lineno PARAMS ((const char *l, size_t len));
 
 struct fileloc lexer_line;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]