about summary refs log tree commit diff
path: root/ChangeLog
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@ezchip.com>2015-01-07 12:29:26 -0500
committerChris Metcalf <cmetcalf@ezchip.com>2015-01-07 12:32:40 -0500
commit39a12f8db4656bec88ebd51e524778ef2e5468b9 (patch)
tree314f0a80e508ca4562fa90a968c51d927b50dfa0 /ChangeLog
parentdc400d7b735c47086a001ed051723e376230cf01 (diff)
downloadglibc-39a12f8db4656bec88ebd51e524778ef2e5468b9.tar.gz
glibc-39a12f8db4656bec88ebd51e524778ef2e5468b9.tar.xz
glibc-39a12f8db4656bec88ebd51e524778ef2e5468b9.zip
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.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog6
1 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d147a0bde7..f5631c351b 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.