[Bug build/25250] New: Build fails with bison 2.3 (macOS's built-in)

wataash at wataash dot com sourceware-bugzilla@sourceware.org
Wed Dec 4 13:48:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=25250

            Bug ID: 25250
           Summary: Build fails with bison 2.3 (macOS's built-in)
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: wataash at wataash dot com
  Target Milestone: ---

With macOS's (Mojave 10.14.6) built-in GNU bison 2.3 (/usr/bin/bison), the
build fails because of the confliction of the keyword `STRING`:

  $ make
  ...
  /bin/sh ../../gdb/../ylwrap ../../gdb/ada-exp.y y.tab.c ada-exp.c.tmp -- \
                bison -y  || (rm -f ada-exp.c.tmp; false)
  g++ -x c++ -std=gnu++11 -g -O2   -I. -I../../gdb -I../../gdb/config
-DLOCALEDIR="\"/Users/wsh/opt/gdb/share/locale\"" -DHAVE_CONFIG_H
-I../../gdb/../include/opcode -I../../gdb/../readline/readline/..
-I../../gdb/../zlib -I../bfd -I../../gdb/../bfd -I../../gdb/../include
-I../libdecnumber -I../../gdb/../libdecnumber  -I../../gdb/../gnulib/import
-I../gnulib/import  -DTUI=1   
-I/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/usr/local/Cellar/source-highlight/3.1.8_12/include
-I/usr/local/opt/boost/include -I../../gdb/.. -pthread -Wall -Wpointer-arith
-Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
-Wempty-body -Wno-sign-compare -Wno-mismatched-tags
-Wno-error=deprecated-register -Wredundant-move -Wformat -Wformat-nonliteral
-Werror -c -o ada-exp.o -MT ada-exp.o -MMD -MP -MF ./.deps/ada-exp.Tpo `if test
-f ada-exp.c; then echo ada-exp.c; else echo ../../gdb/ada-exp.c; fi`
  In file included from ../../gdb/ada-exp.y:38:
  In file included from ../../gdb/defs.h:652:
  In file included from ../../gdb/utils.h:24:
  In file included from ../../gdb/exceptions.h:23:
  ../../gdb/ui-out.h:81:5: error: expected identifier
      STRING,
      ^
  ada-exp.c:125:16: note: expanded from macro 'STRING'
  #define STRING 265
                 ^
  In file included from ../../gdb/ada-exp.y:38:
  In file included from ../../gdb/defs.h:652:
  In file included from ../../gdb/utils.h:24:
  In file included from ../../gdb/exceptions.h:23:
  ../../gdb/ui-out.h:129:26: error: expected unqualified-id
    tmp.kind = field_kind::STRING;
                           ^
  ada-exp.c:125:16: note: expanded from macro 'STRING'
  #define STRING 265
                 ^
  2 errors generated.
  make[2]: *** [ada-exp.o] Error 1
  make[1]: *** [all-gdb] Error 2
  make: *** [all] Error 2

With bison 3.4.2 installed via Homebrew (configure
YACC='/usr/local/Cellar/bison/3.4.2/bin/bison -y'), the build passes.

This failure seems to start at 2a3c1174c, which introduced `enum class
field_kind { STRING }`.  I think the keyword `STRING` should be avoided, or
older bison should be rejected in `configure`.

For reference, I pasted the output of bison on gist:
https://gist.github.com/wataash/a9949604a7b7966cd0a6bbc0a391e349

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list