bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new compiler warning with bison 2.6.5 (PostgreSQL)


From: Peter Eisentraut
Subject: new compiler warning with bison 2.6.5 (PostgreSQL)
Date: Sat, 17 Nov 2012 00:08:45 -0500

When building the SQL grammar in the PostgreSQL source with bison 2.6.5,
a new compiler warning appears:

bison -d -o gram.c gram.y
gcc -O2 -Wlogical-op -Wall -Wmissing-prototypes -Wpointer-arith 
-Wdeclaration-after-statement -Wendif-labels -Wlogical-op 
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv 
-fexcess-precision=standard -g -Wno-error -I. -I. -I../../../src/include 
-D_FORTIFY_SOURCE=2 -DLINUX_OOM_ADJ -D_GNU_SOURCE -I/usr/include/libxml2   -c 
-o gram.o gram.c -MMD -MP -MF .deps/gram.Po
In file included from gram.y:13561:0:
### this is the fault of flex
scan.c: In function ‘yy_try_NUL_trans’:
scan.c:16257:23: warning: unused variable ‘yyg’ [-Wunused-variable]
### this one is new
gram.y: In function ‘base_yyparse’:
gram.c:19961:12: warning: ‘base_yylloc’ is used uninitialized in this function 
[-Wuninitialized]
gram.c:19886:5: note: ‘base_yylloc’ was declared here

I have attached the source and the processed file.  It's pretty easy to
visually verify the problem using the line numbers.

If you want to reproduce the whole thing in context, you can do:

git clone git://git.postgresql.org/git/postgresql.git
cd postgresql
./configure BISON=some/where/bison
make

This should only produce the two warnings shown above.

The issue seems to be related to the change about yylloc warnings
mentioned in the NEWS file.

Attachment: gram.c.xz
Description: application/xz

Attachment: gram.y.xz
Description: application/xz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]