From 12da14a59135fe331f294b91488c1bdf55b35b4e Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 26 Nov 2014 12:54:39 +0000 Subject: Fix warnings in fwscanf / rewind tests. This patch fixes "set but not used" warnings in the tests libio/bug-rewind.c and libio/bug-rewind2.c by checking the return values from fwscanf and making the tests fail if those values aren't as expected. Tested for x86_64. * libio/bug-rewind.c (do_test): Check fwscanf return values. * libio/bug-rewind2.c (do_test): Likewise. --- libio/bug-rewind2.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libio/bug-rewind2.c') diff --git a/libio/bug-rewind2.c b/libio/bug-rewind2.c index 51b5744330..496f628675 100644 --- a/libio/bug-rewind2.c +++ b/libio/bug-rewind2.c @@ -45,6 +45,11 @@ do_test (void) rewind (fp); ret = fwscanf (fp, L"%c", dummy); + if (ret != 1) + { + printf ("fwscanf returned %d, expected 1\n", ret); + result = 1; + } printf ("current pos = %ld\n", ftell (fp)); if (ftell (fp) != 1) -- cgit v1.2.3