From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 659D3385782C for ; Wed, 5 Oct 2022 13:49:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 659D3385782C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664977746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ugIGye69570blLhgtevZst9fI/JefNAcb4J0/b1vRyg=; b=IOWIq0eUnGZtMUxRB3+nrJ60UxIMjZQ/Xo7Fk4deeEwlyM7YNSHWD5XO9Bpz7P4/ioD5MD aLdbwnS6vN7w5xZ6iZWFY3WmbYZupq/iZTvcxFGG9EzpqU1rhgKFj2DqSCEw8NY95ZWJ34 47L07bVI6pzy4BOqYFO1m6STa9u2blI= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-468-NHBatThRN6qGXiz3kCpRvQ-1; Wed, 05 Oct 2022 09:49:05 -0400 X-MC-Unique: NHBatThRN6qGXiz3kCpRvQ-1 Received: by mail-qv1-f71.google.com with SMTP id jn13-20020ad45ded000000b004b1d055fbc7so509980qvb.2 for ; Wed, 05 Oct 2022 06:49:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=ugIGye69570blLhgtevZst9fI/JefNAcb4J0/b1vRyg=; b=b2+gKI+11CFjTctPI2zNFON/N3Gbtkryvioixc1G4GmIAt2nqQMccMxkm7xY3YP6+w GvRGBvBn9nVZa4YlM99evpnyLGV/5dAM58c9Poa4amJ2fnG1bcEIbD6sv3GGCQPln4Ec hxR+CAp+yn75VQ9x/vsnmpMgYikhMQOYmcLUEUjbJEX0IrmmOl9OfFuJ3ix/QzbOHV6D EdxM0YJcuwtnqMbPQSnISRsH/GPUQ0nNjo9prLekHXvm+R4XCetppPq9ZD79v9Pzmaqz IMgcJ/Ebr1+QlAxPKAmQYJQ5ivON2SUA00pd8zNlaUR3AU0pDdYCPpf/FdDXnVTEIJAH VpPg== X-Gm-Message-State: ACrzQf10mC+R43hZ2ZAvB3IEW5xDPBlth3R/EbmIO9IikEWgGGaK/ZzV ANzseFOuwGJsvpGFgtbJLDc0b2EeAcNZ50K07i3rQzyENoUHNvxLKtc77JV8MDFtJQp3OlMqGuD zsSsq6M3C1MJCCb+deUA9 X-Received: by 2002:a05:622a:14c9:b0:35b:b744:a7c8 with SMTP id u9-20020a05622a14c900b0035bb744a7c8mr23350628qtx.570.1664977744933; Wed, 05 Oct 2022 06:49:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BL5Hd+RVoiyRjz1Wt46RzxwH7k3TEU7qL8y0DaidnJuav+I2CEUnETWpLGVdmhKYu7trWTA== X-Received: by 2002:a05:622a:14c9:b0:35b:b744:a7c8 with SMTP id u9-20020a05622a14c900b0035bb744a7c8mr23350609qtx.570.1664977744731; Wed, 05 Oct 2022 06:49:04 -0700 (PDT) Received: from fedora ([66.187.232.65]) by smtp.gmail.com with ESMTPSA id e10-20020a05622a110a00b0035a6d0f7298sm15566891qty.35.2022.10.05.06.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 06:49:04 -0700 (PDT) Date: Wed, 5 Oct 2022 09:49:02 -0400 From: Carlos O'Donell To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 3/6] posix: Suppress -Os may be used uninitialized warnings on regexec Message-ID: References: <20220921135108.3324737-1-adhemerval.zanella@linaro.org> <20220921135108.3324737-4-adhemerval.zanella@linaro.org> MIME-Version: 1.0 In-Reply-To: <20220921135108.3324737-4-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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: On Wed, Sep 21, 2022 at 10:51:05AM -0300, Adhemerval Zanella via Libc-alpha wrote: > GCC with -Os issues may uninitialized warnings on regexec code. LGTM. This is also gnulib code. Needs eventual harmonization. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell > 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; OK. Agreed. > /* Compare the length of input collating element and > the length of current collating element. */ > if (*coll_sym != elem_len) > -- > 2.34.1 >