[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-devel
Subject:    Re: 64bit format strings
From:       Matthias Clasen <matthias.clasen () gmail ! com>
Date:       2006-01-10 19:11:45
Message-ID: cbccc63c0601101111p64591abbq9594ae0562d3d7ef () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

On 1/10/06, Stefan Westerfeld <stefan@space.twc.de> wrote:

>
> So the only remaining question is: does glib-2.x provide a guarantee
> that gint64 (and similar types) work together with PRId64 (and similar
> macros)? Then using PRId64 is a reasonable way to go.
>
> Let me explain the last thing:
>
> On a platform like Linux/AMD64 two integer types are 64bit integer
> types, namely long and long long. These require two different format
> strings, namely "%ld" and "%lld". Now a bad thing to do would be
>
>   typedef long int int64_t; /* <- <stdint.h> */
>   typedef long long gint64; /* <- glib-2.x */
>

From my reading of configure.in, we use the first integral type that
is 8 bytes long,
looking at int, long, long long. So if long and long long are both 64bit, we'll
pick long. Don't know if thats enough of a guarantee for you. It might
be worthwhile
pointing this little pitfall out on gnome-i18n@gnome.org, so that
translators can
watch out for things like this.

Matthias


_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic