Re: amiga-fdisk: ftbfs with GCC-14

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.68k
Message-ID <8b7cc6b77c31ccbfb23ef75eff70efb9b62998ce.camel@physik.fu-berlin.de>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.