On 2/1/2012 18:52, Erik de Castro Lopo wrote: > JonY wrote: > >> Alright, here's a quick fix, although it is more ugly than I remembered. >> >> Basically, it removes those _MSC_VER ifdefs, and relies on inttypes.h >> where available, and falls back to I64 on MSVC and then ll for others, >> all format warnings suppressed. > > JonY, > > Sorry for the delay on actually getting on to this. > > I tried your patch, but it wasn't quite right. The problem is that %ll > is the correct format specifier for uint64_t on 32bit Linux but not > on 64 bit Linux. >
Something is very very wrong about the above statements. I thought I
used PRI?64 when inttypes.h is found (Linux should have it, old code
uses %ll? anyway for non-msvc, so shouldn't have any new issues).
inttypes.h and stdint.h is supposed to be abstractions to remove these
issues.
> In C99, the correct way to print a uint64_t value is:
>
> printf ("THe value is : " PRIu64 "\n", value) ;
>
> I have gone ahead and fixed this through the code and fixed this, but I
> may have broken some either MSVC or MinGW on the way. I'd appreciate it
> if you test whats in git now.
>
> For those files where any compiler baulks at the PRIu64/PRIx64/PRId64,
> you should add a #ifdef block that might look something like:
>
> #ifdef HAVE_INTTYPES_H
> #include <inttypes.h>
> #else
> #if defined (_MSC_VER) && ! defined (PRId64)
> #define PRId64 "I64d"
> #endif
> #if defined (_MSC_VER) && ! defined (PRIu64)
> #define PRIu64 "I64u"
> #endif
> #endif
>
> We'll worry about compilers that don't have the PRI_64 values as we find
> them.
>
OK, I'll do a quick test build tomorrow. More thorough testing will come
during the weekends.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ flac-dev mailing list [email protected] http://lists.xiph.org/mailman/listinfo/flac-dev
