Commit Message
Hi,
on 31bit s390 i get the following warning/error:
tst-widetext.c: In function ‘do_test’:
tst-widetext.c:295:5: error: format ‘%Zd’ expects argument of type
‘signed size_t’, but argument 3 has type ‘int’ [-Werror=format=]
__LINE__, wcp - wc2buf, wcsize);
^
This patch adds a cast to ssize_t in order to disable the warning.
Ok to commit?
Bye
Stefan
---
2014-12-12 Stefan Liebler <stli@linux.vnet.ibm.com>
* libio/tst-widetext.c (do_test):
Cast argument to ssize_t to disable format warning.
Comments
I think %td is the right format for ptrdiff_t.
@@ -292,7 +292,7 @@ do_test (void)
if (fgetws (wcp, &wc2buf[wcsize] - wcp + 1, fp) == NULL)
{
printf ("%u: short read using fgetws (only %Zd of %Zd)\n",
- __LINE__, wcp - wc2buf, wcsize);
+ __LINE__, (ssize_t) (wcp - wc2buf), wcsize);
status = 1;
break;
}