Jim Meyering <[EMAIL PROTECTED]> writes:

> +/* Determine a printf conversion specifier that is appropriate for size_t.
> +   Ideally, we'd just use the c99-specified `z' length modifier, defining
> +   PRI_z to "zu", but that's not portable.  */
> +#if SIZE_MAX == UINT_MAX
> +# define PRI_z "u"
> +#elif SIZE_MAX == ULONG_MAX
> +# define PRI_z "lu"
> +#else
> +# define PRI_z PRIuMAX
> +#endif

I thought about doing that a while ago but gave it up because it
appears that this sort of approach will run afoul of gettext.  That
is, xgettext groks standard C macros like PRIuMAX as a special case,
but it doesn't understand arbitrary C macros that we write.  Hence the
formats won't be entered into the .po files properly.

Also, there might be problems on hosts where UINT_MAX == ULONG_MAX and
size_t is unsigned long int rather than unsigned int.  This latter
problem is fixable, but the other one isn't easily fixable.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to