[PATCH] cipher/rijndael.c: Cast loop variable to unsigned in comparison

Werner Koch wk at gnupg.org
Sat Apr 11 14:59:21 CEST 2015


On Sat, 11 Apr 2015 10:29, paulepanter at users.sourceforge.net said:

> 	lib/libgcrypt-grub/cipher/rijndael.c:352:21: warning: comparison of integers of different signs: 'int' and 'const unsigned int'
> 	      [-Wsign-compare]
> 	      for (i = 0; i < keylen; i++)
>                   ~ ^ ~~~~~~
> 	1 warning generated.
>
> Address the warning by casting the loop variable `i` to unsigned in the
> comparison.

That won't work.  In any case this is not a problem because the range of
these variables is very limited and way below wrapping around.


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gcrypt-devel mailing list