Subj : Re: Galactic Dynasty 2
To : Rushfan
From : Digital Man
Date : Sat Jun 05 2021 01:17 pm
Re: Re: Galactic Dynasty 2
By: Rushfan to Apam on Wed Jun 02 2021 06:26 pm
> BY: apam(21:1/182)
>
>
> |11a|09> |10tomorrow. Seems to be display bugs, I suspect it's because I'm
> trying to|07
> |11a|09> |10display 64 bit integers with 32 bit formatting codes... (most of
> them I|07
> |11a|09> |10did correctly, but %lu comes more naturally than %"PRIu64"
> lol)|07
>
> %llu works on Win32 too with modern compilers (originally it didn't), but
> has for a number of years now. It's also good with GCC.
%llu/d is really only correct for values of type 'long long int' however:
e.g. for values of type off_t, PRIdOFF is more correct:
$ gcc -Wall llu.c
llu.c:7:13: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type '__off_t' {aka 'long int'} [-Wformat=]
printf("%lld", ftello(stdin));
e.g. for values of type uint64_t, PRIu64 is more correct:
$ gcc -Wall llu.c
llu.c:7:13: warning: format '%lld' expects argument of type 'long long int',
but argument 2 has type 'long unsigned int' [-Wformat=]
printf("%lld", (uint64_t)ftello(stdin));
But I agree, those inttypes.h printf-formatting macros are not very convenient or easy to remember.
--
digital man
Sling Blade quote #10:
Morris: I stand on the hill, not for thrill, but for the breath of a fresh kill
Norco, CA WX: 79.4�F, 48.0% humidity, 11 mph ENE wind, 0.00 inches rain/24hrs