diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-01-29 14:26:23 +0100 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2016-01-29 21:19:30 -0500 |
commit | a7ff1b23a9049767e1df308bf5313a477ea07935 (patch) | |
tree | 815c99a6fbd411150811bd10456c72d594a99d06 /src/flex.skl | |
parent | 4936786fc5b748a071687e8d25ae042374e374e6 (diff) |
Marked declaration and definition of yy_fatal_error as noreturn.
Only the declaration of yy_fatal_error is marked with
__attribute__((__noreturn__)) in case GCC >= 3 is used, but not the
definition. This leads to the sparse static checker to complain about
function declaration mismatch.
Fix it by defining a macro yynoreturn and using it for both the
declaration and the definition of yy_fatal_error.
Diffstat (limited to 'src/flex.skl')
-rw-r--r-- | src/flex.skl | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/flex.skl b/src/flex.skl index 0374ecd..bb9685e 100644 --- a/src/flex.skl +++ b/src/flex.skl @@ -226,6 +226,12 @@ m4preproc_include(`flexint.h') /* TODO: this is always defined, so inline it */ #define yyconst const +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + %# For compilers that can not handle prototypes. %# e.g., %# The function prototype @@ -737,10 +743,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], static yy_state_type yy_get_previous_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); static yy_state_type yy_try_NUL_trans M4_YY_PARAMS( yy_state_type current_state M4_YY_PROTO_LAST_ARG); static int yy_get_next_buffer M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG ); -#if defined(__GNUC__) && __GNUC__ >= 3 -__attribute__((__noreturn__)) -#endif -static void yy_fatal_error M4_YY_PARAMS( yyconst char* msg M4_YY_PROTO_LAST_ARG ); +static void yynoreturn yy_fatal_error M4_YY_PARAMS( yyconst char* msg M4_YY_PROTO_LAST_ARG ); ]]) %endif @@ -2549,7 +2552,7 @@ m4_ifdef( [[M4_YY_NO_TOP_STATE]],, #endif %if-c-only -static void yy_fatal_error YYFARGS1(yyconst char*, msg) +static void yynoreturn yy_fatal_error YYFARGS1(yyconst char*, msg) { M4_YY_DECL_GUTS_VAR(); M4_YY_NOOP_GUTS_VAR(); |