changeset 37899:67ef6269251b

regex: pacify static checkers Problem and draft fix reported by Aharon Robbins in: http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html * lib/regcomp.c (build_charclass_op, create_tree) [lint]: Clear memory to pacify static checkers.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 18 Jan 2016 10:34:18 -0800
parents 1949d83abae5
children e9cf11801c56
files ChangeLog lib/regcomp.c
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jan 18 10:32:26 2016 -0800
+++ b/ChangeLog	Mon Jan 18 10:34:18 2016 -0800
@@ -1,5 +1,11 @@
 2016-01-18  Paul Eggert  <eggert@cs.ucla.edu>
 
+	regex: pacify static checkers
+	Problem and draft fix reported by Aharon Robbins in:
+	http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html
+	* lib/regcomp.c (build_charclass_op, create_tree) [lint]:
+	Clear memory to pacify static checkers.
+
 	regex: fix [ diagnostic
 	Problem and fix reported by Aharon Robbins in:
 	http://lists.gnu.org/archive/html/bug-gnulib/2016-01/msg00082.html
--- a/lib/regcomp.c	Mon Jan 18 10:32:26 2016 -0800
+++ b/lib/regcomp.c	Mon Jan 18 10:34:18 2016 -0800
@@ -3727,6 +3727,9 @@
 #endif
 
   /* Build a tree for simple bracket.  */
+#ifdef lint
+  memset (&br_token, 0, sizeof br_token);
+#endif
   br_token.type = SIMPLE_BRACKET;
   br_token.opr.sbcset = sbcset;
   tree = create_token_tree (dfa, NULL, NULL, &br_token);
@@ -3821,6 +3824,9 @@
 	     re_token_type_t type)
 {
   re_token_t t;
+#ifdef lint
+  memset (&t, 0, sizeof t);
+#endif
   t.type = type;
   return create_token_tree (dfa, left, right, &t);
 }