Re: [PATCH 02/11] convert-dtsv0: Fix signedness comparisons warning

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



On Mon, Oct 12, 2020 at 05:19:39PM +0100, Andre Przywara wrote:
> With -Wsign-compare, compilers warn about a mismatching signedness in
> comparisons in the generated lexer code.
> 
> In this case we walk over an array, and never use negative indicies, so
> we can change the loop counter variable to be unsigned.
> 
> This fixes "make convert-dtsv0", when compiled with -Wsign-compare.
> 
> Signed-off-by: Andre Przywara <andre.przywara@xxxxxxx>

Applied, thanks.

> ---
>  convert-dtsv0-lexer.l | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/convert-dtsv0-lexer.l b/convert-dtsv0-lexer.l
> index f52e8a1..7a66f57 100644
> --- a/convert-dtsv0-lexer.l
> +++ b/convert-dtsv0-lexer.l
> @@ -94,7 +94,7 @@ static const struct {
>  <INITIAL>[0-9a-fA-F]+	{
>  			unsigned long long val;
>  			int obase = 16, width = 0;
> -			int i;
> +			unsigned int i;
>  
>  			val = strtoull(yytext, NULL, cbase);
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux