Wireshark-dev: [Wireshark-dev] Remove the PRI...64 macros completely?
From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Sat, 18 Nov 2006 03:15:53 +0100
Hi List!

We currently still recommend to use the PRI...64 macros when supplying 64bit values in the format string to printf like functions.

This was needed as Win32 MSVC like printf (sprintf, snprintf, ...) and such functions need e.g. %I64d to format such a 64 bit value while gcc uses %lld for this.

As we now recommend to use the corresponding functions from the glib (e.g. g_snprintf) this situation changed - these functions takes both %I64d and %lld :-)

What makes things worse is that the glib functions have a bug when using I64X and I64x (see bugzilla 1025) - in effect I've changed that PRIx64 macros a while ago to simply also use the gcc like %llx :-)


As a conclusion: the best way to handle this IMHO is to simply use %lld and alike for all printf like function format strings. This should work on all platforms and we could just delete the PRI...64 macros and replace each appearance with it's %lld replacement.

This makes usage of the glib printf like functions mandatory, but this is the way we recommend it anway ...

Any comments?

Regards, ULFL