This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.20-260-g12da14a
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 26 Nov 2014 12:54:58 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.20-260-g12da14a
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 12da14a59135fe331f294b91488c1bdf55b35b4e (commit)
from bd5dadac87467eec9d6ffc3f1b11897ea052a636 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=12da14a59135fe331f294b91488c1bdf55b35b4e
commit 12da14a59135fe331f294b91488c1bdf55b35b4e
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Nov 26 12:54:39 2014 +0000
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.
diff --git a/ChangeLog b/ChangeLog
index 3ae83e6..5581f08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2014-11-26 Joseph Myers <joseph@codesourcery.com>
+ * libio/bug-rewind.c (do_test): Check fwscanf return values.
+ * libio/bug-rewind2.c (do_test): Likewise.
+
* debug/test-stpcpy_chk-ifunc.c: Remove file.
* debug/test-strcpy_chk-ifunc.c: Likewise.
* wcsmbs/test-wcschr-ifunc.c: Likewise.
diff --git a/libio/bug-rewind.c b/libio/bug-rewind.c
index 4f8242d..1734de2 100644
--- a/libio/bug-rewind.c
+++ b/libio/bug-rewind.c
@@ -52,9 +52,19 @@ do_test (void)
rewind (fptr);
ret1 = fwscanf (fptr, L"%c%c", &arg1, &arg2);
+ if (ret1 != 2)
+ {
+ printf ("first fwscanf returned %d, expected 2\n", ret1);
+ return 3;
+ }
rewind (fptr);
ret2 = fwscanf (fptr, L"%c%n%c", &arg1, &num, &arg2);
+ if (ret2 != 2)
+ {
+ printf ("second fwscanf returned %d, expected 2\n", ret2);
+ return 4;
+ }
if (arg2 != 'd')
{
diff --git a/libio/bug-rewind2.c b/libio/bug-rewind2.c
index 51b5744..496f628 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)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 3 +++
libio/bug-rewind.c | 10 ++++++++++
libio/bug-rewind2.c | 5 +++++
3 files changed, 18 insertions(+), 0 deletions(-)
hooks/post-receive
--
GNU C Library master sources