[PATCH] Replace %z in format strings with configure-time determined printf length modifier
Mike Hommey
mh+jemalloc at glandium.org
Wed Apr 11 05:33:24 PDT 2012
On Wed, Apr 11, 2012 at 02:27:27PM +0200, Mike Hommey wrote:
> From: Mike Hommey <mh at glandium.org>
>
> ---
> configure.ac | 14 +++++++++
> include/jemalloc/jemalloc_defs.h.in | 8 ++++++
> src/prof.c | 2 +-
> src/stats.c | 54 +++++++++++++++++------------------
> test/aligned_alloc.c | 14 ++++-----
> test/allocm.c | 22 +++++++-------
> test/mremap.c | 6 ++--
> test/posix_memalign.c | 14 ++++-----
> test/rallocm.c | 16 +++++------
> 9 files changed, 86 insertions(+), 64 deletions(-)
Disclaimer: no effort has been made to wrap strings. It's merely the
result of a big sed (plus configure and preprocessed header glue).
Note that this leads to compiler warnings with mingw64 (warning: unknown
conversion type character 'l' in format [-Wformat]), but I suspect this
is a bug in mingw64 (and as a matter of fact, the resulting printfs do
the right thing ; fwiw, I sent a message on the mingw64 list, but it's
awaiting moderation). MSVC is happy with %llu, too.
The defines in jemalloc_defs.h mimic inttypes.h PRI* macros.
Mike
More information about the jemalloc-discuss
mailing list