[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printf(3): add support for z and t modifiers
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: Re: printf(3): add support for z and t modifiers
- From: Otto Moerbeek <otto_(_at_)_drijf_(_dot_)_net>
- Date: Sat, 18 Sep 2004 21:34:36 +0200 (CEST)
On Sat, 18 Sep 2004, Otto Moerbeek wrote:
> Hi,
>
> this adds support for the C99 z and t modifiers to printf(3).
>
> Currently, the only safe way to print a size_t v is:
>
> printf("%llu", (unsigned long long) v);
>
> Since the size of size_t can be 32 or 64 bits, depending on arch.
>
> With this diff you can just do:
>
> printf("%zu", v);
>
> '%td' can be used in the same way for ptrdiff_t.
>
> Please review and test this diff; it promises to make lives of C
> programmers easier.
Well, sometimes things move fast. This has just been commited. But that
does not mean that testing and reviewing is futile...
-Otto
Visit your host, monkey.org