mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
glr.c: fix use of _Noreturn
In C++, [[noreturn]] must not be between "static" and the rest of the function signature, it must precede it. C's _Noreturn does not seem to have such a constraint, but it is therefore compatible with the C++ constraint. Since we #define _Noreturn as [[noreturn]] is modern C++, be sure to push the _Noreturn first. Unfortunately this was not caught by the test suite, because it always loads config.h first, and config.h contains another definition of _Noreturn that does not use [[noreturn]], and hides ours. That's probably a sign we should avoid always loading config.h. * data/glr.c (yyFail, yyMemoryExhausted): here.
This commit is contained in:
@@ -708,7 +708,7 @@ struct yyGLRStack {
|
||||
static void yyexpandGLRStack (yyGLRStack* yystackp);
|
||||
#endif
|
||||
|
||||
static _Noreturn void
|
||||
_Noreturn static void
|
||||
yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
||||
{
|
||||
if (yymsg != YY_NULLPTR)
|
||||
@@ -716,7 +716,7 @@ yyFail (yyGLRStack* yystackp]b4_pure_formals[, const char* yymsg)
|
||||
YYLONGJMP (yystackp->yyexception_buffer, 1);
|
||||
}
|
||||
|
||||
static _Noreturn void
|
||||
_Noreturn static void
|
||||
yyMemoryExhausted (yyGLRStack* yystackp)
|
||||
{
|
||||
YYLONGJMP (yystackp->yyexception_buffer, 2);
|
||||
|
||||
Reference in New Issue
Block a user