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-258-g3b20fd5
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 26 Nov 2014 12:52:28 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.20-258-g3b20fd5
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 3b20fd5c0df2621a38d128bb9d7ba145cdd4657c (commit)
from 704f794714704ba430d84d10d6809acaf7ca59bf (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=3b20fd5c0df2621a38d128bb9d7ba145cdd4657c
commit 3b20fd5c0df2621a38d128bb9d7ba145cdd4657c
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Nov 26 12:52:08 2014 +0000
Fix test-strchr.c warnings for wide string testing.
string/test-strchr.c is used for both wide and narrow string testing,
but produces a series of warnings for wide string testing because of
hardcoded use of narrow characters in the function check1. This patch
fixes that function to use macros abstracting away the wide / narrow
string choice, adding a new such macro to handle the string and
character constants.
Tested for x86_64.
* string/test-strchr.c [!WIDE] (L): New macro.
[WIDE] (L): Likewise.
(check1): Use CHAR instead of char. Use L on string and character
constants.
diff --git a/ChangeLog b/ChangeLog
index efd18ee..66a78e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-11-26 Joseph Myers <joseph@codesourcery.com>
+
+ * string/test-strchr.c [!WIDE] (L): New macro.
+ [WIDE] (L): Likewise.
+ (check1): Use CHAR instead of char. Use L on string and character
+ constants.
+
2014-11-26 Adhemerval Zanella <azanella@linux.ibm.com>
* csu/tst-atomic.c (do_test): Add atomic_exchange_and_add_{acq,rel}
diff --git a/string/test-strchr.c b/string/test-strchr.c
index 12cd9d8..fe2dfd2 100644
--- a/string/test-strchr.c
+++ b/string/test-strchr.c
@@ -44,6 +44,7 @@
# define MIDDLE_CHAR 127
# define SMALL_CHAR 23
# define UCHAR unsigned char
+# define L(s) s
#else
# include <wchar.h>
# define STRCHR wcschr
@@ -53,6 +54,7 @@
# define MIDDLE_CHAR 1121
# define SMALL_CHAR 851
# define UCHAR wchar_t
+# define L(s) L ## s
#endif
#ifdef USE_FOR_STRCHRNUL
@@ -219,9 +221,9 @@ do_random_tests (void)
static void
check1 (void)
{
- char s[] __attribute__((aligned(16))) = "\xff";
- char c = '\xfe';
- char *exp_result = stupid_STRCHR (s, c);
+ CHAR s[] __attribute__((aligned(16))) = L ("\xff");
+ CHAR c = L ('\xfe');
+ CHAR *exp_result = stupid_STRCHR (s, c);
FOR_EACH_IMPL (impl, 0)
check_result (impl, s, c, exp_result);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
string/test-strchr.c | 8 +++++---
2 files changed, 12 insertions(+), 3 deletions(-)
hooks/post-receive
--
GNU C Library master sources