From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 2D8073858C2D for ; Fri, 12 May 2023 19:44:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D8073858C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="5713145" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 12 May 2023 11:44:12 -0800 IronPort-SDR: eZEUg8gvJ/zpBfv/LN9IRr0hAKlx8GJgYttnLkjm5IRf/bww9PrI6LtKPP4kWMInk+9seroTjR XnOBHyWbPwfjZfKGOqRPyHcbBt29zXLjoTtJQ9zkw94oHXuSblwDtQw+u9f7kJrt6jgX94f4ob cFyeGq7mw9JUblCu8yXHuWSN8aLfriyZ3ZwaxUdBIpssJKLxSXxZnFiFpslyvS90/jRATPgGD4 udHnk40kVHoshFs4Lro3Ow6gn2Q9P8IXFLiaQ256XntoC5AwCHvOB2RkZ74+VSajMn9hZMvXbR AIY= Date: Fri, 12 May 2023 19:44:07 +0000 From: Joseph Myers To: Florian Weimer CC: Eli Zaretskii , Jakub Jelinek , , , , , Subject: Re: More C type errors by default for GCC 14 In-Reply-To: <871qjlh9t3.fsf@mid.deneb.enyo.de> Message-ID: <17f43e65-2eb1-9ff1-d1c6-ba647d913f97@codesourcery.com> References: <87y1lx1avj.fsf@oldenburg.str.redhat.com> <83ednoapb6.fsf@gnu.org> <831qjoa0g0.fsf@gnu.org> <83o7ms8is7.fsf@gnu.org> <2ffbf210-1b58-737b-888c-4f84c5cc5e0f@gmail.com> <837ctg8e98.fsf@gnu.org> <83wn1g6w67.fsf@gnu.org> <83mt2c6tch.fsf@gnu.org> <871qjlh9t3.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3106.5 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, 12 May 2023, Florian Weimer wrote: > This sone seems to be a good candidate for additional errors, though: > > warned_here = pedwarn > (loc, warn_return_type >= 0 ? OPT_Wreturn_type : 0, > "% with no value, in function returning non-void"); > > It's a clear type volation that can lead to obscure bugs. Maybe the > converse as well. This one is valid before C99 (the pedwarn is conditional on flag_isoc99, otherwise it's a warning). The converse is unconditionally invalid (though the case where the returned expression from the function with void return type itself has void type is valid in C++ and only a pedwarn-if-pedantic for C; that case is a reasonable extension). -- Joseph S. Myers joseph@codesourcery.com