Re: AC_PROG_LEX issue when compiling with -Werror

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux