This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] S390: Fix build error in iconvdata/bug-iconv11.c
- From: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 19 Jan 2016 17:39:21 +0100
- Subject: [PATCH] S390: Fix build error in iconvdata/bug-iconv11.c
- Authentication-results: sourceware.org; auth=none
Hi,
I get the following build error on S390 31bit while building the test
iconvdata/bug-iconv11.c with gcc 5.3:
gcc bug-iconv11.c -c -std=gnu11 -fgnu89-inline -O3 -Wall -Werror
-Wundef -Wwrite-strings -fmerge-all-constants -frounding-math
-Wstrict-prototypes -Wold-style-definition -mlong-double-128
-I../include -I/home/stli/glibcDir/glibc-20160119_31-build/iconvdata
-I/home/stli/glibcDir/glibc-20160119_31-build
-I../sysdeps/unix/sysv/linux/s390/s390-32
-I../sysdeps/unix/sysv/linux/s390/fpu -I../sysdeps/s390/fpu
-I../sysdeps/unix/sysv/linux/s390 -I../sysdeps/s390/nptl
-I../sysdeps/ieee754/ldbl-64-128 -I../sysdeps/ieee754/ldbl-opt
-I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux
-I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu
-I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix
-I../sysdeps/posix -I../sysdeps/s390/s390-32/multiarch
-I../sysdeps/s390/s390-32 -I../sysdeps/wordsize-32
-I../sysdeps/s390/multiarch -I../sysdeps/s390
-I../sysdeps/ieee754/ldbl-128 -I../sysdeps/ieee754/dbl-64
-I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic
-I.. -I../libio -I. -D_LIBC_REENTRANT -include
/home/stli/glibcDir/glibc-20160119_31-build/libc-modules.h
-DMODULE_NAME=nonlib -include ../include/libc-symbols.h -o
/home/stli/glibcDir/glibc-20160119_31-build/iconvdata/bug-iconv11.o -MD
-MP -MF
/home/stli/glibcDir/glibc-20160119_31-build/iconvdata/bug-iconv11.o.dt
-MT /home/stli/glibcDir/glibc-20160119_31-build/iconvdata/bug-iconv11.o
bug-iconv11.c: In function âtest_ibm93xâ:
bug-iconv11.c:59:11: error: format â%tdâ expects argument of type
âptrdiff_tâ, but argument 2 has type âsize_t {aka long unsigned int}â
[-Werror=format=]
printf (" ==> %td: %s\n"
^
cc1: all warnings being treated as errors
This patch uses %zu format specifier for argument size_t ret instead of %td.
Ok to commit?
Bye
Stefan
ChangeLog:
* iconvdata/bug-iconv11.c (test_ibm93x):
Use %zu printf format specifier for size_t argument.
diff --git a/iconvdata/bug-iconv11.c b/iconvdata/bug-iconv11.c
index 6cdc07d..5b9d9a3 100644
--- a/iconvdata/bug-iconv11.c
+++ b/iconvdata/bug-iconv11.c
@@ -56,7 +56,7 @@ test_ibm93x (const char *from_set, const char *input, size_t inbytesleft)
errno = 0;
size_t ret = iconv (cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
- printf (" ==> %td: %s\n"
+ printf (" ==> %zu: %s\n"
" inbuf%+td, inbytesleft=%zu, outbuf%+td, outbytesleft=%zu\n",
ret, strerror (errno),
inbuf - input, inbytesleft, outbuf - output, outbytesleft);