Hi,

On Sun, 2024-08-18 at 11:19 +0200, Geert Uytterhoeven wrote:
> > > I tried defining n in fdisk.c as unsigned int but this caused even more
> > > warnings in other places.  Do I have to cast the arguments in sscanf to
> > > unsigned int?  It wants "unsigned int *", is it as simple as this or is
> > > there a better solution?
> > 
> > In this case, I would just recommend to use the proper format specifiers, 
> > see:
> 
> "%x" and "%o" always operate on unsigned values.  There are no
> format specifiers for signed hexadecimal and octal values, unlike for
> decimal values ("%u" vs. "%d").

OK, so if the numbers are never supposed to be negative, then the variables 
should
be declared as unsigned in the first place. I would avoid casting the types as
this can often cause other problems.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply via email to