Re: [hatari-devel] 2 warnings while compiling

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Am Fri, 27 Dec 2013 23:30:51 +0100
schrieb Nicolas Pomarède <npomarede@xxxxxxxxxxxx>:

> Le 27/12/2013 23:24, Laurent Sallafranque a écrit :
> > Hi,
> >
> > While compiling hatari, I get the 2 following warnings :
> >
> > [ 59%] Building C object src/CMakeFiles/hatari.dir/fdc.c.o
> > /home/laurent/Atari/hatari/src/fdc.c: In function
> > ‘FDC_IndexPulse_Update’: /home/laurent/Atari/hatari/src/fdc.c:1319:3:
> > attention : format ‘%lld’ expects argument of type ‘long long int’,
> > but argument 6 has type ‘Uint64’ [-Wformat]
> > /home/laurent/Atari/hatari/src/fdc.c: In function
> > ‘FDC_IndexPulse_Init’: /home/laurent/Atari/hatari/src/fdc.c:1353:2:
> > attention : format ‘%lld’ expects argument of type ‘long long int’,
> > but argument 6 has type ‘Uint64’ [-Wformat]
> 
> Hi
> 
> I don't have this error, can you change %lld to %llu to see ?

That's a common problem when printing 64-bit values ... Uint64 is
defined to "unsigned long long" on 32-bit systems and "unsigned long"
on 64-bit systems. You either have to typecast the variable to
"unsigned long long" for the printf (ugly), or you can use the macros
PRIu64 from inttypes.h as format string instead (see hg commit cfad9b1735c5
as an example).

 Thomas



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/