Skip to content

Commit

Permalink
Guard yyunput_r definition with YY_NO_YYUNPUT
Browse files Browse the repository at this point in the history
The declaration had the ifdef, but the defintion was missing it, thus
lexers that don't use yyunput would generate an unused static function
warning.
  • Loading branch information
taniwha authored and westes committed Oct 19, 2023
1 parent 63665f4 commit 7efebe2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cpp-flex.skl
Original file line number Diff line number Diff line change
Expand Up @@ -2685,6 +2685,7 @@ m4_ifdef([[M4_MODE_NULTRANS_WRAP]], [[
m4_ifdef([[M4_MODE_CXX_ONLY]], [[m4_undefine([[M4_YY_NO_YYUNPUT]])]])
m4_ifdef( [[M4_YY_NO_YYUNPUT]], , [[
m4_ifdef([[M4_MODE_C_ONLY]], [[
#ifndef YY_NO_YYUNPUT
static void yyunput_r YYFARGS2( int,c, char *,yy_bp)
]])
m4_ifdef([[M4_MODE_CXX_ONLY]], [[
Expand Down Expand Up @@ -2734,6 +2735,9 @@ m4_ifdef( [[M4_MODE_YYLINENO]],
YY_G(yy_hold_char) = *yy_cp;
YY_G(yy_c_buf_p) = yy_cp;
}
m4_ifdef([[M4_MODE_C_ONLY]], [[
#endif /* ifndef YY_NO_YYINPUT */
]])
]])

m4_ifdef([[M4_MODE_C_ONLY]], [[
Expand Down

0 comments on commit 7efebe2

Please sign in to comment.