Skip to content

Commit bc6c74b

Browse files
committed
[gdb/build] Fix YYSTYPE and yyalloc odr violation
When building gdb with -O2 -flto I run into: ... ada-exp.c.tmp:576:7: error: type ‘union YYSTYPE’ violates the C++ One \ Definition Rule [-Werror=odr] ... Fix this by renaming to ada_exp_YYSTYPE and likewise for other .y files. Likewise for yyalloc. Tested on x86_64-linux. Also tested with byacc rather than bison on suggestion of Tom Tromey. Approved-By: Tom Tromey <[email protected]> PR build/22395 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395
1 parent fdeef5e commit bc6c74b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gdb/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,6 +2509,8 @@ po/$(PACKAGE).pot: force
25092509
-e 's/\([ \t;,(]\)free$$/\1xfree/g' \
25102510
-e '/^#line.*y.tab.c/d' \
25112511
-e 's/YY_NULL/YY_NULLPTR/g' \
2512+
-e "s/YYSTYPE/$(subst -,_,$*)_YYSTYPE/g" \
2513+
-e "s/yyalloc/$(subst -,_,$*)_yyalloc/g" \
25122514
< $@.tmp > $@.new && \
25132515
rm -f $@.tmp && \
25142516
mv $@.new $@

0 commit comments

Comments
 (0)