bug-bison
[Top][All Lists]
Advanced

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

bison-2.6.4-generated parser triggers pragma warnings in GCC 6.4.3


From: Peter Simons
Subject: bison-2.6.4-generated parser triggers pragma warnings in GCC 6.4.3
Date: Wed, 24 Oct 2012 17:40:25 +0200

Hi,

after updating to Bison version 2.6.4, I can no longer build Grub 2.00 because
of the following warnings:

  grub_script.tab.c: In function 'grub_script_yyparse':
  grub_script.tab.c:1534:3: error: unknown option after '#pragma GCC 
diagnostic' kind [-Werror=pragmas]
  grub_script.tab.c:2168:3: error: unknown option after '#pragma GCC 
diagnostic' kind [-Werror=pragmas]
  cc1: all warnings being treated as errors

These warnings are triggered by the YY_IGNORE_MAYBE_UNINITIALIZED_{BEGIN,END}
macros in the following source code snippet of the generated parser:

  /* Discard the shifted token.  */
  yychar = YYEMPTY;

  yystate = yyn;
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  *++yyvsp = yylval;
  YY_IGNORE_MAYBE_UNINITIALIZED_END

  goto yynewstate;

This issue occurs on with GCC 4.6.3 on Linux/x86_64. The exact command line
while compiling the file is:

  gcc -DHAVE_CONFIG_H -I. -Wall -W -I./include -DGRUB_UTIL=1 \
    
-DGRUB_LIBDIR=\"/nix/store/kiid4baicbp7xrxx63yqnxpfgx9bdm6h-grub-2.00/lib/grub\"
 \
    
-DLOCALEDIR=\"/nix/store/kiid4baicbp7xrxx63yqnxpfgx9bdm6h-grub-2.00/share/locale\"
 \
    -DGRUB_FILE=\"grub_script.tab.c\" -I. -I. -I. -I. -I./include -I./include \
    -I./grub-core/lib/minilzo -I./grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H 
\
    -Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra \
    -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment \
    -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero \
    -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args \
    -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration \
    -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain \
    -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute \
    -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses \
    -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point \
    -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef \
    -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label \
    -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros \
    -Wvolatile-register-var -Wwrite-strings -Wnested-externs \
    -Wstrict-prototypes -Wpointer-sign -Werror -fno-builtin -Wno-undef \
    -Wno-error=missing-noreturn -c -o libgrubmods_a-grub_script.tab.o \
    grub_script.tab.c

Is there a way to remedy that issue?

Take care,
Peter



reply via email to

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