This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.20-498-g39a12f8


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  39a12f8db4656bec88ebd51e524778ef2e5468b9 (commit)
      from  dc400d7b735c47086a001ed051723e376230cf01 (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=39a12f8db4656bec88ebd51e524778ef2e5468b9

commit 39a12f8db4656bec88ebd51e524778ef2e5468b9
Author: Chris Metcalf <cmetcalf@ezchip.com>
Date:   Wed Jan 7 12:29:26 2015 -0500

    posix/regcomp: initialize union structure tag to avoid warning
    
    We see some surprising warnings on tilegx with gcc 4.8.2:
    
    In file included from regex.c:66:0:
    regcomp.c: In function â??parse_expressionâ??:
    regcomp.c:2849:15: error: â??end_elemâ?? may be used uninitialized in this
    function [-Werror=maybe-uninitialized]
           else if (br_elem->type == COLL_SYM)
                   ^
    regcomp.c:3109:34: note: â??end_elemâ?? was declared here
           bracket_elem_t start_elem, end_elem;
                                      ^
    regcomp.c:3109:22: error: â??start_elemâ?? may be used uninitialized in
    this function [-Werror=maybe-uninitialized]
           bracket_elem_t start_elem, end_elem;
                          ^
    
    These warnings are not seen on x86, and in fact if I compile the
    preprocessed tile sources with the x86 gcc 4.8.2, I don't see the
    warnings.  I do see eqiuvalent warnings if I compile the
    x86-preprocessed source code with tilegx gcc 4.8.2.
    
    The fix here is to initialize the union type field appropriately in
    a couple of places where we pass a union pointer to a subroutine that
    "knows" what type the union is.  Setting the type explicitly seems like
    a more robust way to manage such a data structure in any case.

diff --git a/ChangeLog b/ChangeLog
index d147a0b..f5631c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-07  Chris Metcalf  <cmetcalf@ezchip.com>
+
+	* posix/regcomp.c (parse_bracket_exp): Initialize type to
+	COLL_SYM in a couple of places to avoid uninitialized variable
+	wanings on tilegx gcc 4.8.2.
+
 2015-01-07  Richard Earnshaw  <rearnsha@arm.com>
 
 	* sysdeps/aarch64/strcpy.S: New file.
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 8e6d2f8..fefbf67 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -3114,6 +3114,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       re_token_t token2;
 
       start_elem.opr.name = start_name_buf;
+      start_elem.type = COLL_SYM;
       ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa,
 				   syntax, first_round);
       if (BE (ret != REG_NOERROR, 0))
@@ -3157,6 +3158,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       if (is_range_exp == 1)
 	{
 	  end_elem.opr.name = end_name_buf;
+	  end_elem.type = COLL_SYM;
 	  ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2,
 				       dfa, syntax, 1);
 	  if (BE (ret != REG_NOERROR, 0))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog       |    6 ++++++
 posix/regcomp.c |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]