mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Using #define YYSTYPE has always been strongly discouraged in C++. Macros are dangerous and can result in subtle bugs. https://lists.gnu.org/r/bug-bison/2020-12/msg00007.html Maybe some people are currently using #define YYSTYPE. Instead of dropping support right now, first issue a warning. Bison can "see" if YYDEBUG is defined (it could even be on the command line), only the compiler knows. Unfortunately `#warning` is non-portable, and actually GCC even dies on it when `-pedantic` is enabled. So we need to use `#pragma message`. We must make it conditional as some compilers might not support it, but it doesn't matter if only _some_ compilers emit the warning: it should be enough to catch the attention of the developers. * data/skeletons/c++.m4: Issue a warning when the user defined YYSTYPE. * tests/actions.at: Don't #define YYSTYPE. * tests/headers.at (Several parsers): Ignore the YYSTYPE in the warning.