From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 89EED3857C44 for ; Wed, 27 Oct 2021 16:10:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 89EED3857C44 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: rERi0pd+CdgtSz5/oT1ViLCFMpPer4LcjJY02AWvrCkh6QPPzY55XW6C0Leif5NzuqGBccIGqN +EGDB/HyrQd4BomgjgEI8P0l7i8byl3TOtelhwZ7hHWMxY/mDmMKdfmZ0MpjohbCEfouEIrnlD GtuVcLXn4cYGxcCXKqViKfK1u2dwAvdRk5beqQXNxu0A8rx8fPOIg+Sjn/06zjJjPkGp4Xb8Hr 9rub/XS3eESW+xDHV3/ZTV9Mou+TOk1KUywPCI1RZiia+u608gHMTdo6qbyaCZPy45BOVdRvpL i0G5TdygRFCOn0cG8T0Tap+6 X-IronPort-AV: E=Sophos;i="5.87,187,1631606400"; d="scan'208";a="67545486" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 27 Oct 2021 08:10:59 -0800 IronPort-SDR: 8ALNnLohoxmkEQQZQBempeEWN/OHNDDy5/Xg0Cq7eBmNbzfM2P4yc9FrB+3Gr87namlK8yFo8k FjWAoSW9AbnpDWlQ4PyH5YdAx9+82rW9DH+Sy9r4bmsFGTD2AAt3FumDkLT61aHvgoRZF0mXCF qlb4QqaU3KgVHT6QyrF+xtHoYyO4deC1I8Mz6BaVXEYLnr4ZfWJEtxjse8BJufl5V6GUIdCeCz pVA7YjK/4fs+nZnAg/8MUDhnl4kN/sam+3P73K2DZAnZxaM7qmv2/FjahnuIwEtkx5/mZBCJKi mXA= Date: Wed, 27 Oct 2021 16:10:52 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Paul Eggert CC: Fangrui Song , Subject: Re: [PATCH] regex: Unnest nested functions in regcomp.c In-Reply-To: Message-ID: References: <20211027052959.2549214-1-maskray@google.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3117.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2021 16:11:01 -0000 On Wed, 27 Oct 2021, Paul Eggert wrote: > On 10/26/21 22:29, Fangrui Song wrote: > > collseqwc, table_size, symb_table, extra are now initialized to appease > > GCC -Werror=maybe-uninitialized false positive. > > Are the diagnostics really false positives? As I understand it, the modified > code would have undefined behavior if these variables were not initialized. And if they are false positives, the glibc convention in such cases is generally to use the DIAG_* macros from libc-diag.h to suppress the warnings, with appropriate comments explaining why they are false positives, rather than adding an initialization that should not be necessary. (Sometimes another approach is more appropriate to warning suppression - for example, a call to __builtin_unreachable that enables the compiler to see that certain paths through the code cannot actually occur.) -- Joseph S. Myers joseph@codesourcery.com