[PATCH 0/9] BZ #17732: Many test failures on ILP32 targets
H.J. Lu
hongjiu.lu@intel.com
Fri Dec 19 22:11:00 GMT 2014
Hi,
On ILP32 targets like x32, I got error like
tst-fmemopen2.c: In function âdo_testâ:
tst-fmemopen2.c:24:7: error: format â%ldâ expects argument of type âlong intâ, but argument 2 has type âoff_tâ [-Werror=format=]
printf ("first ftello returned %ld, expected %zu\n", o, nstr);
^
tst-fmemopen2.c:31:7: error: format â%ldâ expects argument of type âlong intâ, but argument 2 has type âoff_tâ [-Werror=format=]
printf ("second ftello returned %ld, expected 0\n", o);
^
tst-fmemopen2.c:42:7: error: format â%ldâ expects argument of type âlong intâ, but argument 2 has type âoff_tâ [-Werror=format=]
printf ("third ftello returned %ld, expected %zu\n", o, nstr);
^
tst-fmemopen2.c:53:7: error: format â%ldâ expects argument of type âlong intâ, but argument 2 has type âoff_tâ [-Werror=format=]
printf ("fourth ftello returned %ld, expected %zu\n", o, nstr2);
^
cc1: all warnings being treated as errors
Joseph suggested casting 64-bit values to intmax_t for printf and using
%jd. The following 9 patches implemented it. Tested on x32, i686 and
x86-64.
H.J. Lu (9):
Replace %ld with %jd and cast to intmax_t
Replace %ld with %jd and cast to intmax_t
Replace %ld with %jd and cast to intmax_t
Replace %ld with %jd and cast to intmax_t
Replace %ld/%lu with %jd/%ju and cast to intmax_t/uintmax_t
Replace %ld with %jd and cast to intmax_t
Replace %ld with %jd and cast to intmax_t
Replace %ld with %jd and cast to intmax_t
Replace %ld with %jd and cast to intmax_t
ChangeLog | 31 +++++++++++++++++++++++++++++++
io/test-utime.c | 12 ++++++++----
libio/tst-ftell-active-handler.c | 12 ++++++------
nptl/tst-mutex5.c | 5 +++--
posix/tst-regex.c | 16 ++++++++--------
rt/tst-clock.c | 9 +++++----
rt/tst-cpuclock1.c | 38 ++++++++++++++++++++------------------
rt/tst-cpuclock2.c | 22 ++++++++++++----------
rt/tst-mqueue1.c | 10 ++++++----
rt/tst-mqueue3.c | 8 ++++----
rt/tst-mqueue4.c | 14 ++++++++------
rt/tst-timer4.c | 25 +++++++++++++------------
stdio-common/tst-fmemopen2.c | 11 +++++++----
sysdeps/pthread/tst-timer.c | 8 ++++----
time/clocktest.c | 4 ++--
time/tst-posixtz.c | 3 ++-
timezone/tst-timezone.c | 8 ++++----
17 files changed, 143 insertions(+), 93 deletions(-)
--
1.9.3
More information about the Libc-alpha
mailing list