From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id BEBC33857416; Wed, 5 Oct 2022 21:43:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEBC33857416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665006219; bh=stK3cX4Sr6Se1OofDclrq10SqfQDq92XvmQDLm+YyT4=; h=From:To:Subject:Date:From; b=d2uaQ620LgKIGY3790LyfIr9ws1zBqbpqvaw23oWrOJOhcthqNq7Rv4yN9ekxcI5O QENzVE7e1Pv1eSTWfvI6ib1jpFkST+Uq6nlqo2j0mSTSXBRRTfULq2RBfWlBHZ7Dx9 xpnJOa0Ub6y70HevNXFda9MHLVew0gyJQbz7Q4wc= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] posix: Suppress -Os may be used uninitialized warnings on regexec X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella Netto X-Git-Refname: refs/heads/master X-Git-Oldrev: 9ec1c8cd243e9d7d63e188620a7e70a3b69777e6 X-Git-Newrev: 442e3a21724b07b3ae1c3c5eeba4a8e44a1a50a3 Message-Id: <20221005214339.BEBC33857416@sourceware.org> Date: Wed, 5 Oct 2022 21:43:39 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=442e3a21724b07b3ae1c3c5eeba4a8e44a1a50a3 commit 442e3a21724b07b3ae1c3c5eeba4a8e44a1a50a3 Author: Adhemerval Zanella Netto Date: Wed Sep 21 10:51:05 2022 -0300 posix: Suppress -Os may be used uninitialized warnings on regexec GCC with -Os issues may uninitialized warnings on regexec code. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell Diff: --- posix/regexec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/posix/regexec.c b/posix/regexec.c index cffeaf2845..386a757f35 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -3768,7 +3768,13 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx, _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); for (i = 0; i < cset->ncoll_syms; ++i) { + /* The compiler might warn that extra may be used uninitialized, + however the loop will be executed iff ncoll_syms is larger + than 0,which means extra will be already initialized. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized"); const unsigned char *coll_sym = extra + cset->coll_syms[i]; + DIAG_POP_NEEDS_COMMENT; /* Compare the length of input collating element and the length of current collating element. */ if (*coll_sym != elem_len)