Detect and use %zu for size_t when available
authorAndrew Deason <adeason@sinenomine.net>
Mon, 12 Oct 2009 02:55:05 +0000 (21:55 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 15 Oct 2009 19:15:38 +0000 (12:15 -0700)
commit58628eb745acdf4b1b7e9f5ab828e4ca0fa18b81
tree89b0d8d694dcc53c044db10400f4af8dfd0f4a7e
parent1fa650cee2d6cc708ee29a963ad3498a808bbde8
Detect and use %zu for size_t when available

Commit db949b7fade69d7eb1e38ad85d5b822c443306cb was incorrect and
generated warnings on many platforms; we cannot determine the correct
format string for a size_t at compile-time. Instead use the %z length
modifier when we can detect that it is safe to use. Otherwise, fall back
to just %lu on Unix, since it is reasonable to assume
sizeof(size_t) == sizeof(unsigned long) on Unix.

Reviewed-on: http://gerrit.openafs.org/647
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
acinclude.m4
src/cf/sizet.m4 [new file with mode: 0644]
src/config/stds.h