>From 4995acd81a426303125c8a9b34c01bd3aa064dde Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 18 Jan 2016 10:34:18 -0800 Subject: [PATCH 3/3] 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. --- ChangeLog | 6 ++++++ lib/regcomp.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index d4779a1..b9da935 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 1eda110..f86ce06 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); } -- 2.5.0