When I build gdb in Mac OS 13.2.1 (22D68), it report error here. The macro DOT is conflate with enum split_style::DOT. Maybe we should replace one of the ./split-name.h:34:3: error: expected identifier DOT, ^ m2-exp.c:163:13: note: expanded from macro 'DOT' #define DOT 302 ^ In file included from m2-exp.y:42: In file included from ./language.h:26: ./symtab.h:308:23: error: expected unqualified-id style = split_style::DOT; ^ m2-exp.c:163:13: note: expanded from macro 'DOT' #define DOT 302
On Linux, my generated m2-exp.c also contains a `#define DOT 302`, and I don't see that problem. Out of curiosity, which bison/yacc tool version is used in your build to convert m2-exp.y to m2-exp.c? Can you attach the generated m2-exp.c file?
Another report of this PR here ( https://sourceware.org/pipermail/gdb/2023-August/050862.html ), mentioning GNU Bison 2.3.
Bison 2.3, released in 2006, with many releases after... maybe this is another one of those "Apple hates GPLv3" things? I'd suggest trying to build with a bison from brew. However if we know that 2.3 works otherwise, I guess it is pretty easy to rename split_style::DOT. But -- do we know this?
Sending a fix.
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fe26aa95336c0ddec01b407b990caf2c758fd93f commit fe26aa95336c0ddec01b407b990caf2c758fd93f Author: Tom Tromey <tromey@adacore.com> Date: Thu Aug 31 07:33:34 2023 -0600 Rename split_style::DOT This renames split_style::DOT, to avoid name clashes when building gdb with an old version of Bison (2.3, the version available on macOS). In particular the error looks like: ./split-name.h:34:3: error: expected identifier DOT, ^ m2-exp.c:163:13: note: expanded from macro 'DOT' Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30286
Fixed.