[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_PROG_LEX issue when compiling with -Werror
From: |
Todd C. Miller |
Subject: |
Re: AC_PROG_LEX issue when compiling with -Werror |
Date: |
Thu, 14 Jul 2022 07:56:44 -0600 |
On Thu, 14 Jul 2022 12:03:42 +0200, Tobias Brunner wrote:
> This is caused by the following warnings turned errors from the
> generated lexer:
>
> lex.yy.c:673:13: error: misleading indentation; statement is not part of
> the previous 'if' [-Werror,-Wmisleading-indentation]
> if ( ! (yy_state_buf) )
> ^
> lex.yy.c:671:9: note: previous statement is here
> if ( ! (yy_state_buf) )
> ^
> lex.yy.c:1107:3: error: misleading indentation; statement is not part of
> the previous 'if' [-Werror,-Wmisleading-indentation]
> return yy_is_jam ? 0 : yy_current_state;
> ^
> lex.yy.c:1104:2: note: previous statement is here
> if ( ! yy_is_jam )
> ^
>
> Note that these warnings are not triggered for our own lexers,
> presumably because we don't use REJECT, which seems to generate the
> above code. That is, building with -Werror works just fine if the
> library check is bypassed.
Why not just fix your flex.skl so it doesn't produce code that
generates a warning? We fixed this problem in OpenBSD so you can
probably just adapt the indentation changes from:
https://github.com/openbsd/src/commit/1e0c6b38375efb02b888b583b475861337640240
https://github.com/openbsd/src/commit/f185ba58eb4e17172f33aba354b7b635e52cea2c
The test program does not generate warnings with clang 13 on OpenBSD.
- todd