]> Savannah Git Hosting - gnulib.git/commitdiff
regex: pacify static checkers
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Jan 2016 18:34:18 +0000 (10:34 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Jan 2016 18:38:36 +0000 (10:38 -0800)
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.

ChangeLog
lib/regcomp.c

index d4779a12a0790095540efba163243036de819d35..b9da9354e2498d6a13534c371ad40ebd50662610 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 1eda11009de10437ef9652917304a8b8569612bb..f86ce06a5cfc85a5394c591714096eaa8355629c 100644 (file)
@@ -3727,6 +3727,9 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
 #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 @@ create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
             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);
 }