This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
egcs, PATCH to fix warnings in gperf generated files ...
- To: egcs-patches at cygnus dot com
- Subject: egcs, PATCH to fix warnings in gperf generated files ...
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Thu, 1 Oct 1998 23:30:15 -0400 (EDT)
Here is my stab at cleaning up warnings in the gperf generated
files in gcc/, gcc/cp, and gcc/ch. There are mainly two types of
warnings coming from these headers:
> c-gperf.h:43: warning: array subscript has type `char'
and:
> c-gperf.h:54: warning: missing initializer for `wordlist[0].token'
Since these are generated files, I decided to fix these during
generation in the Makefiles by passing the output from gperf through sed
to add the appropriate anti-warning fixes.
(Jeff, I recall you don't like different directory ChangeLogs merged
like this. But each was a two-liner so I thought it would be okay to
include them all in this one message.)
The end result is 268 less warnings. :-) Okay to install?
--Kaveh
Thu Oct 1 19:51:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (c-gperf.h): Postprocess gperf output to eliminate
warnings.
diff -rup orig/egcs-CVS19980930/gcc/Makefile.in egcs-CVS19980930/gcc/Makefile.in
--- orig/egcs-CVS19980930/gcc/Makefile.in Wed Sep 30 20:31:07 1998
+++ egcs-CVS19980930/gcc/Makefile.in Thu Oct 1 19:18:54 1998
@@ -1264,7 +1264,9 @@ $(srcdir)/c-parse.y: c-parse.in
$(srcdir)/c-gperf.h: c-parse.gperf
gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$$ \
- $(srcdir)/c-parse.gperf >tmp-gperf.h
+ $(srcdir)/c-parse.gperf | \
+ sed 's/\(asso_values\[\)\(str\[.*\]\];\)/\1(unsigned char)\2/' | \
+ sed 's/{"",}/{"", 0, 0}/g' > tmp-gperf.h
$(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) c-tree.h c-lex.h flags.h \
Thu Oct 1 19:51:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (hash.h): Postprocess gperf output to eliminate
warnings.
diff -rup orig/egcs-CVS19980930/gcc/ch/Makefile.in egcs-CVS19980930/gcc/ch/Makefile.in
--- orig/egcs-CVS19980930/gcc/ch/Makefile.in Wed Sep 30 20:31:55 1998
+++ egcs-CVS19980930/gcc/ch/Makefile.in Thu Oct 1 19:33:15 1998
@@ -265,8 +265,9 @@ $(srcdir)/hash.h:
gawk '{ printf ("s/^%s,/%s,/\n", $$1, toupper ($$1)) }' < gperf.tmp > sed.tmp
sed -f sed.tmp < gperf.tmp > gperf.tmp2
cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp
- gperf -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' gperf.tmp \
- > $(srcdir)/hash.h
+ gperf -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' gperf.tmp | \
+ sed 's/\(asso_values\[\)\(str\[.*\]\];\)/\1(unsigned char)\2/' | \
+ sed 's/{"",}/{"", 0, 0, 0}/g' > $(srcdir)/hash.h
$(RM) gperf.tmp gperf.tmp2 sed.tmp
actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
Thu Oct 1 19:51:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (hash.h): Postprocess gperf output to eliminate
warnings.
diff -rup orig/egcs-CVS19980930/gcc/cp/Makefile.in egcs-CVS19980930/gcc/cp/Makefile.in
--- orig/egcs-CVS19980930/gcc/cp/Makefile.in Wed Sep 30 20:30:51 1998
+++ egcs-CVS19980930/gcc/cp/Makefile.in Thu Oct 1 19:26:04 1998
@@ -241,7 +241,9 @@ $(PARSE_C) : $(srcdir)/parse.y
# Thus you have to remove hash.h to force it to be re-made.
$(srcdir)/hash.h:
gperf -p -j1 -g -o -t -N is_reserved_word '-k1,4,7,$$' \
- $(srcdir)/gxx.gperf >$(srcdir)/hash.h
+ $(srcdir)/gxx.gperf | \
+ sed 's/\(asso_values\[\)\(str\[.*\]\];\)/\1(unsigned char)\2/' | \
+ sed 's/{"",}/{"", 0, 0}/g' >$(srcdir)/hash.h
spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) \
$(PARSE_H) $(srcdir)/../flags.h lex.h $(srcdir)/../system.h