Skip to content

Commit

Permalink
Fixed issue westes#416: Made YY_DO_BEFORE_ACTION a do-while loop to f…
Browse files Browse the repository at this point in the history
…ix -Wextra-semi-stmt warnings
  • Loading branch information
seanm authored and westes committed Sep 6, 2023
1 parent 6db99cc commit 2c0b6c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cpp-flex.skl
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
do { \
YY_G(yytext_ptr) = yy_bp; \
m4_ifdef([[M4_MODE_YYMORE_USED]], [[m4_ifdef([[M4_MODE_NO_YYTEXT_IS_ARRAY]], [[YY_G(yytext_ptr) -= YY_G(yy_more_len); \
yyleng = (int) (yy_cp - YY_G(yytext_ptr));]])]]) \
Expand All @@ -871,7 +872,8 @@ m4_ifdef([[M4_MODE_YYTEXT_IS_ARRAY]], [[ \
m4_ifdef([[M4_MODE_YYMORE_USED]], [[YY_G(yy_more_offset) = 0;]]) \
m4_ifdef([[M4_MODE_NO_YYMORE_USED]], [[yy_flex_strncpy( yytext, YY_G(yytext_ptr), yyleng + 1 M4_YY_CALL_LAST_ARG);]]) \
]]) \
YY_G(yy_c_buf_p) = yy_cp;
YY_G(yy_c_buf_p) = yy_cp; \
} while(0)

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

0 comments on commit 2c0b6c7

Please sign in to comment.