On Wed, 30 Dec 2009 07:51:01 +0100 (CET)
Vincent Torri <vtorri@...> wrote:
> On Wed, 30 Dec 2009, Vincent Torri wrote:
> > On Wed, 30 Dec 2009, Gustavo Sverzut Barbieri wrote:
> >> On Wed, Dec 30, 2009 at 12:07 AM, Enlightenment SVN
> >> <no-reply@...> wrote:
> >>> Log:
> >>> Fix printing of size_t value(s). (removes compiler warning).
> >> They invented "z" modifier for that, see "man 3 printf"
> it is also a gnu extension:
> "glibc 2.1 adds length modifiers hh,j,t,z and conversion characters
%z is part of C99.
So for C99 it's %zi of %zd.
C99 also has the PRIx macros for printing all integer types safely.
Unfortunately there is no safe way of printing it in C89 (ie windows).
The best way is:
printf("... %ld..",(unsigned int)blah);