Skip to content

Commit 7f11968

Browse files
committed
Warning GCC and Clang : Empty lines : %option '-L'
- Fixed [-Wmisleading-indentation] waning of clang(v10+) and gcc(v6+) - Fixed a problem with a sequence of empty lines ('\n' sequence) - Fixed a bugs with '-L' options (%top print a '#line')
1 parent 159682c commit 7f11968

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

flex/src/buf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
9595
const char *src;
9696
size_t tsz;
9797

98-
if (gen_line_dirs)
99-
return buf;
98+
if (!gen_line_dirs)
99+
return buf;
100100

101101
tsz = strlen("#line \"\"\n") + /* constant parts */
102102
2 * strlen (filename) + /* filename with possibly all backslashes escaped */

flex/src/skel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,8 +1651,8 @@ const char *skel[] = {
16511651
" /* Create the reject buffer large enough to save one state per allowed character. */",
16521652
" if ( ! YY_G(yy_state_buf) )",
16531653
" YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE M4_YY_CALL_LAST_ARG);",
1654-
" if ( ! YY_G(yy_state_buf) )",
1655-
" YY_FATAL_ERROR( \"out of dynamic memory in yylex()\" );",
1654+
" if ( ! YY_G(yy_state_buf) )",
1655+
" YY_FATAL_ERROR( \"out of dynamic memory in yylex()\" );",
16561656
"]])",
16571657
"",
16581658
" if ( ! YY_G(yy_start) )",
@@ -2181,7 +2181,7 @@ const char *skel[] = {
21812181
"%% [17.0] code to find the next state, and perhaps do backing up, goes here",
21822182
"",
21832183
" M4_YY_NOOP_GUTS_VAR();",
2184-
" return yy_is_jam ? 0 : yy_current_state;",
2184+
"return yy_is_jam ? 0 : yy_current_state;",
21852185
"}",
21862186
"",
21872187
"",

0 commit comments

Comments
 (0)