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] Fix bootstrap


Hi all,

my bootstrap (CVS HEAD) on alpha-unknown-linux-gnu dies with:

stage1/xgcc -Bstage1/ -B/home/obj/alpha/install/alpha-unknown-linux-gnu/bin/ 
-c   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes 
-Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -fno-common 
-Werror   -DHAVE_CONFIG_H -DGENERATOR_FILE    -I. -I. 
-I/home/ritzert/nfs/compile/gcc/HEAD/gcc/gcc 
-I/home/ritzert/nfs/compile/gcc/HEAD/gcc/gcc/. 
-I/home/ritzert/nfs/compile/gcc/HEAD/gcc/gcc/config 
-I/home/ritzert/nfs/compile/gcc/HEAD/gcc/gcc/../include 
/home/ritzert/nfs/compile/gcc/HEAD/gcc/gcc/genoutput.c -o genoutput.o
/home/ritzert/nfs/compile/gcc/HEAD/gcc/gcc/genoutput.c: In function 
`validate_insn_alternatives':
/home/ritzert/nfs/compile/gcc/HEAD/gcc/gcc/genoutput.c:756: warning: `c' might 
be used uninitialized in this function
make[2]: *** [genoutput.o] Error 1
make[2]: Leaving directory `/home/obj/alpha/gcc-HEAD/gcc'
make[1]: *** [stage2_build] Error 2
make[1]: Leaving directory `/home/obj/alpha/gcc-HEAD/gcc'
make: *** [bootstrap] Error 2

The fix appears simple (see below). Still I wonder why apparently nobody else 
gets this error.

Michael

2003-01-29  Michael Ritzert  <ritzert@t-online.de>

	* genoutput.c (validate_insn_alternatives): Initialize c to avoid
	a warning.

Index: genoutput.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genoutput.c,v
retrieving revision 1.73
diff -u -3 -p -r1.73 genoutput.c
--- genoutput.c 13 Jan 2003 21:37:08 -0000      1.73
+++ genoutput.c 29 Jan 2003 22:25:49 -0000
@@ -753,7 +753,7 @@ validate_insn_alternatives (d)
       {
        int len, i;
        const char *p;
-       char c;
+       char c = 0;
        int which_alternative = 0;
        int alternative_count_unsure = 0;



c is unconditionally set to *p only for lines below, so initializing to any 
value should be save.


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