From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id A7B0238582BC for ; Wed, 21 Sep 2022 13:51:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A7B0238582BC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x232.google.com with SMTP id j188so8185370oih.0 for ; Wed, 21 Sep 2022 06:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date; bh=CE1k8Onsa/tQDOXcHL+21MrbamO/Z8q+UjMxt9koZp0=; b=gopXygAU8S7aOER2qI9iPv0fAe9ERjjqKD8JIPu5l1D9vDzQtUTQ1tji2vGE45N/hw IkITxatPX2yqgRrfTyy6gwx7Akk91kwJEQFQTOnEPUc3gTuChj2MM/x+mAUta9SAZwX5 ajmKzOqC67Zh3I8d29OzPgMYmp+nNff+X2J2qmHlsXmbT3tHQ1oXJK7yVv1JkFmHj97T Vor88qCN0e3ByoAUoC3Ts3PGo33nuGO8aTARU+Q99n25F7V3uFhBeHowTPkjeSjj76cm 5T9Y7khMkSeAYSitGMEGX+KrKzua3Qec/4BprzPj173RB7VCsAER6ywm1PpPVZzFcskQ NEcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=CE1k8Onsa/tQDOXcHL+21MrbamO/Z8q+UjMxt9koZp0=; b=m9d0GDuj6aBfQHp03lLkQXLSSojkKAmDfEN7XNdCRvLnTdBEfegaGPJX7dvXwAi490 OVz19rqDPrH1pzOTmXcdXje1UfbmtMJOB6WkLSOCMpQFQpHFRBXWy2nM1ssFsTWcc3Q6 atbVfetnqxeUuhiaL1J3M+BrDBx2b3uDIehT/gBo2aXMBANANua6Q539UK6UasNFgKk3 qVU/3T31IXcZNFW7XqiWTF2UAtAyO9xMiOQy7Lh8Yt81IyZ3Os5SkQnE379LgkqFfdRe EoJvrcnfdprvPffpUNVdAWckFKqzWXbG4gjeWEcRbfvF2SqkRrSYFRqNz/tjeFklN+Hn UYMw== X-Gm-Message-State: ACrzQf3iHduhYN0+MosuSuKau2+4K+yLY91LmOHPyQzMnHOZZt/5NjgC WyTEnLxmGQe70AHQbgWzyLrHY7dzb3kcQVgN X-Google-Smtp-Source: AMsMyM5Mrc/whNRMFQrXO+LvXul6R9Ufu6UzvACZycJVigCNAIIavP80I3Nint3d5TTVWfsfdExO5A== X-Received: by 2002:a05:6808:1597:b0:350:4f39:d7d2 with SMTP id t23-20020a056808159700b003504f39d7d2mr3743450oiw.125.1663768282808; Wed, 21 Sep 2022 06:51:22 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:c266:dbbf:9e84:6582:5289]) by smtp.gmail.com with ESMTPSA id a38-20020a05687046a600b0010bf07976c9sm1669476oap.41.2022.09.21.06.51.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 06:51:22 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/6] posix: Suppress -Os may be used uninitialized warnings on regexec Date: Wed, 21 Sep 2022 10:51:05 -0300 Message-Id: <20220921135108.3324737-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220921135108.3324737-1-adhemerval.zanella@linaro.org> References: <20220921135108.3324737-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: GCC with -Os issues may uninitialized warnings on regexec code. Checked on x86_64-linux-gnu and i686-linux-gnu. --- 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) -- 2.34.1