From: Paul Eggert Date: Mon, 18 Jan 2016 18:34:18 +0000 (-0800) Subject: regex: pacify static checkers X-Git-Tag: v1.0~6839 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=336fa860d2a1c5696a04edb64af37bc1c83afb9a;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index d4779a12a0..b9da9354e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2016-01-18 Paul Eggert + 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 diff --git a/lib/regcomp.c b/lib/regcomp.c index 1eda11009d..f86ce06a5c 100644 --- a/lib/regcomp.c +++ b/lib/regcomp.c @@ -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); }