Dave - here is a patch for these warnings and some others I was seeing with gcc 4.4.3.
-Luc
-----Original Message-----
From: Dave Anderson [mailto:anderson@xxxxxxxxxx]
Sent: Thu 1/19/2012 3:07 PM
To: Discussion list for crash utility usage, maintenance and development
Cc: Luc Chouinard
Subject: SIAL and bison 2.5
Hi Luc,
I note a new set of bison complaints on a Fedora 16 machine:
# make extensions
gcc -Wall -nostartfiles -shared -rdynamic -o echo.so echo.c -fPIC -DX86_64 -DGDB_7_3_1
gcc -Wall -nostartfiles -shared -rdynamic -o trace.so trace.c -fPIC -DX86_64 -DGDB_7_3_1
gcc -Wall -nostartfiles -shared -rdynamic -o dminfo.so dminfo.c -fPIC -DX86_64 -DGDB_7_3_1
cd libsial && make
bison -psial -v -t -d sial.y
sial.y:107.22: warning: a `;' might be needed at the end of action code
sial.y:107.22: warning: future versions of Bison will not add the `;'
sial.y:107.36: warning: a `;' might be needed at the end of action code
sial.y:107.36: warning: future versions of Bison will not add the `;'
sial.y:111.26: warning: a `;' might be needed at the end of action code
sial.y:111.26: warning: future versions of Bison will not add the `;'
sial.y:111.40: warning: a `;' might be needed at the end of action code
sial.y:111.40: warning: future versions of Bison will not add the `;'
sial.y:424.25: warning: a `;' might be needed at the end of action code
sial.y:424.25: warning: future versions of Bison will not add the `;'
sial.y:424.39: warning: a `;' might be needed at the end of action code
sial.y:424.39: warning: future versions of Bison will not add the `;'
sial.y: conflicts: 252 shift/reduce, 20 reduce/reduce
cc -O3 -g -fPIC -c -o sial_util.o sial_util.c
cc -O3 -g -fPIC -c -o sial_node.o sial_node.c
cc -O3 -g -fPIC -c -o sial_var.o sial_var.c
cc -O3 -g -fPIC -c -o sial_func.o sial_func.c
cc -O3 -g -fPIC -c -o sial_str.o sial_str.c
cc -O3 -g -fPIC -c -o sial_op.o sial_op.c
cc -O3 -g -fPIC -c -o sial_num.o sial_num.c
cc -O3 -g -fPIC -c -o sial_stat.o sial_stat.c
cc -O3 -g -fPIC -c -o sial_builtin.o sial_builtin.c
cc -O3 -g -fPIC -c -o sial_type.o sial_type.c
cc -O3 -g -fPIC -c -o sial_case.o sial_case.c
cc -O3 -g -fPIC -c -o sial_api.o sial_api.c
cc -O3 -g -fPIC -c -o sial_member.o sial_member.c
cc -O3 -g -fPIC -c -o sial_alloc.o sial_alloc.c
cc -O3 -g -fPIC -c -o sial_define.o sial_define.c
cc -O3 -g -fPIC -c -o sial_input.o sial_input.c
cc -O3 -g -fPIC -c -o sial_print.o sial_print.c
bison -psialpp -v -t -d sialpp.y
sialpp.y: conflicts: 23 shift/reduce
cc -O3 -g -fPIC -c sialpp.tab.c
cc -O3 -g -fPIC -c sial.tab.c
flex -L -Psial -t sial.l > lex.sial.c
cc -O3 -g -fPIC -c lex.sial.c
flex -Psialpp -t sialpp.l > lex.sialpp.c
cc -O3 -g -fPIC -c lex.sialpp.c
cc -O3 -g -fPIC -o mkbaseop mkbaseop.c
./mkbaseop > baseops.c
cc -O3 -g -fPIC -c baseops.c
ar ccurl libsial.a sial_util.o sial_node.o sial_var.o sial_func.o sial_str.o sial_op.o sial_num.o sial_stat.o sial_builtin.o sial_type.o sial_case.o sial_api.o sial_member.o sial_alloc.o sial_define.o sial_input.o sial_print.o sialpp.tab.o sial.tab.o lex.sial.o lex.sialpp.o baseops.o
gcc -g -I.. -Ilibsial -I../gdb-7.3.1/bfd -I../gdb-7.3.1/include -I../gdb-7.3.1/gdb -I../gdb-7.3.1/gdb/config -I../gdb-7.3.1/gdb/common -I../gdb-7.3.1 -nostartfiles -shared -rdynamic -o sial.so sial.c -fPIC -DX86_64 -DGDB_7_3_1 -Llibsial -lsial
gcc -Wall -I. -nostartfiles -shared -rdynamic -o snap.so snap.c -fPIC -DX86_64 -DGDB_7_3_1
#
Since the warnings don't show up with bison 2.4.1,
I'm guessing it's something new in version 2.5:
# bison --version
bison (GNU Bison) 2.5
Written by Robert Corbett and Richard Stallman.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
Probably worth cleaning up now rather than later?
Thanks,
Dave
diff -Naur crash-6.0.2/extensions/libsial/mkbaseop.c crash-6.0.2.new/extensions/libsial/mkbaseop.c --- crash-6.0.2/extensions/libsial/mkbaseop.c 2011-12-22 10:17:31.000000000 -0500 +++ crash-6.0.2.new/extensions/libsial/mkbaseop.c 2012-01-23 22:02:26.326308706 -0500 @@ -129,7 +129,7 @@ /* create the array from within which the runtime functions will indexed to get a function pointer */ - printf("void (*opfuncs[%d][%d][%d])()={\n", NTYPS, NTYPS, NOPS); + printf("void (*opfuncs[%lu][%lu][%lu])()={\n", NTYPS, NTYPS, NOPS); for(i=0;i<NTYPS;i++) { @@ -151,7 +151,7 @@ printf("};\n"); /* output a ops lut */ - printf("\nstatic int opslut[%d]={\n", NOPS); + printf("\nstatic int opslut[%lu]={\n", NOPS); for(i=0;i<NOPS;i++) { @@ -167,12 +167,12 @@ {\n\ int i;\n\ \n\ - for(i=0;i<%d;i++) {\n\ + for(i=0;i<%lu;i++) {\n\ \n\ if(opslut[i]==op) break;\n\ \n\ }\n\ - if(i==%d) sial_error(\"Oops!ops!\");\n\ + if(i==%lu) sial_error(\"Oops!ops!\");\n\ (opfuncs[v1->type.idx][v2->type.idx][i])(v1,v2,ret);\n\ }\n", NOPS, NOPS); exit(0); diff -Naur crash-6.0.2/extensions/libsial/sial.y crash-6.0.2.new/extensions/libsial/sial.y --- crash-6.0.2/extensions/libsial/sial.y 2011-12-22 10:17:31.000000000 -0500 +++ crash-6.0.2.new/extensions/libsial/sial.y 2012-01-23 21:55:16.116457913 -0500 @@ -104,11 +104,11 @@ ; if: - IF '(' {VARON} term {VAROFF} ')' { $$ = $4; } + IF '(' {VARON;} term {VAROFF;} ')' { $$ = $4; } ; switch : - SWITCH '(' {VARON} term {VAROFF} ')' '{' caselist '}' + SWITCH '(' {VARON;} term {VAROFF;} ')' '{' caselist '}' { $$ = sial_newstat(SWITCH, 2, $4, $8); } ; @@ -421,7 +421,7 @@ ; while: - WHILE '(' {VARON} term {VAROFF} ')' { $$ = $4; } + WHILE '(' {VARON;} term {VAROFF;} ')' { $$ = $4; } ; %% diff -Naur crash-6.0.2/extensions/libsial/sial_builtin.c crash-6.0.2.new/extensions/libsial/sial_builtin.c --- crash-6.0.2/extensions/libsial/sial_builtin.c 2011-12-22 10:17:31.000000000 -0500 +++ crash-6.0.2.new/extensions/libsial/sial_builtin.c 2012-01-23 21:58:03.365942558 -0500 @@ -137,7 +137,6 @@ char *s=sial_getptr(vs, char); int base=vbase ? sial_getval(vbase) : 0; - strtoull(s, 0, (int) base); return sial_defbtypesize(sial_newval(), strtoull(s, 0, base), B_ULL); } diff -Naur crash-6.0.2/extensions/libsial/sial_func.c crash-6.0.2.new/extensions/libsial/sial_func.c --- crash-6.0.2/extensions/libsial/sial_func.c 2011-12-22 10:17:31.000000000 -0500 +++ crash-6.0.2.new/extensions/libsial/sial_func.c 2012-01-23 22:04:37.685560409 -0500 @@ -810,8 +810,7 @@ if(!ed) ed="vi"; snprintf(buf, sizeof(buf), "%s +%d %s", ed, line, fname); - system(buf); - sial_load(fname); + if(!system(buf)) sial_load(fname); } /* diff -Naur crash-6.0.2/extensions/libsial/sial_util.c crash-6.0.2.new/extensions/libsial/sial_util.c --- crash-6.0.2/extensions/libsial/sial_util.c 2011-12-22 10:17:31.000000000 -0500 +++ crash-6.0.2.new/extensions/libsial/sial_util.c 2012-01-23 22:06:13.687398281 -0500 @@ -102,7 +102,7 @@ int i; if(lf) fprintf(ofile, "\n"); - for(i=0;i <tabs; i++) fprintf(ofile, t); + for(i=0;i <tabs; i++) fprintf(ofile, "%s", t); return tabs*4; }
-- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility