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 <tom@tromey.com>
PR build/22395
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395
-e 's/\([ \t;,(]\)free$$/\1xfree/g' \
-e '/^#line.*y.tab.c/d' \
-e 's/YY_NULL/YY_NULLPTR/g' \
+ -e "s/YYSTYPE/$(subst -,_,$*)_YYSTYPE/g" \
+ -e "s/yyalloc/$(subst -,_,$*)_yyalloc/g" \
< $@.tmp > $@.new && \
rm -f $@.tmp && \
mv $@.new $@