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 183353857C69 for ; Thu, 30 Nov 2023 16:17:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 183353857C69 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 183353857C69 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701361080; cv=none; b=S3lKPvX1YCWEP3jQJBaROL72Lno+QVVmMo7L84WkgAAHWzMsWJDqndoe9B12EIvBjuqTGtV1X+JQlIuxCGcod20LnqegaFnHGryvBR32TODjQnoykvG3g5ezrFPa5BYwCrsD6JKdIx3p76ujQuqHPujpcUb9lZAw4zw0WFUcI+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701361080; c=relaxed/simple; bh=nAAzb9XFFd5topzstY2QrGyMJfRWoJLAmcN2CxsLK58=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=acTECsxQBmjHOgNyLeZF5MROvlTNiBeLhiIFAXtd1M0oEK5mClQdotV8C0LqrwMbp+mvMwzc/DhOcRx/BdPzGq7wo9M8BL5MM+3auIfwP8eaWhreNe4oyuwgaeaMz/Dw/hMecV36X58gkawyKl9MKkz71MU7QBAf4R0xq09zVkQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701361077; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xh9hO/9THLEbHrnLGBuFNv3WkBGhN3UPCXWmrhdCzug=; b=cbIbQdbkX26P07goeuwSutDX8VwFGR6xA63smsNIW0dAFRzTqgfmCPs88Mxnvx1FhISM+b lwpuLhWgnMCIxjiq5tueFJ6nQ7EbUMgpJ2zWanG/CSj/x4loF/MBN+Oo4DgOzn6BguCs5U 2+VfPtfEu1UmzPdUE5dglrEoYZSB7+c= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-218-9FrWmtrxOS-Jn1UppHo3_A-1; Thu, 30 Nov 2023 11:17:56 -0500 X-MC-Unique: 9FrWmtrxOS-Jn1UppHo3_A-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-77d6bade8d4so133221185a.1 for ; Thu, 30 Nov 2023 08:17:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701361076; x=1701965876; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xh9hO/9THLEbHrnLGBuFNv3WkBGhN3UPCXWmrhdCzug=; b=Etgi5b8fkA9NpP3KvCp56pijbEEuB062V0yh4MQyXKxpi8GTELRVWTbZHnpRk+MEIl YynnbYaRM3Rri3d/9IH4u/HXLxyhE1TJ7PDbpr95qQcZDRo3L4RgIBeRd9ysZJ+TVcCC PVsCMyp5lfU97hab6rs9Ot1U5va99dh6Bkd214QLlN2t2GetnvTlmmYjN08UZMPFnDpq 6dDqKL+sHC1osoD6aONhctDSN6QstOgQwCyp0Z+FREDH6OrPguedXOElLMhBMcdJPVD1 889mw7kn7xo1wFIqe58Dd4wxa9P7jULe5VzLdl0bWkt926zJDxoeEG/jxL4GsoOIq+m/ qOGg== X-Gm-Message-State: AOJu0Yx6WF5Sej+juw61P9p8Z/VXQa1X1dj7PWiYl0tLDpL+JvyiB1HX w94N+k46Zijxk3MDXr5HxckU4vR1rxCvVrrxOH+nf7R8XTtj667x2hdIeKwUuke2DBS5cy1P0HO 7S52F6kcO9T13X6I0DQ== X-Received: by 2002:a05:620a:2099:b0:77d:ce42:2d4d with SMTP id e25-20020a05620a209900b0077dce422d4dmr4891018qka.2.1701361076046; Thu, 30 Nov 2023 08:17:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IECZUFUsbaLM1ENDemtppRYx5CJOYt0lNCTCVmYRCzMWCS2ybfxnN3IXKr0/xABQqCDc9UKFQ== X-Received: by 2002:a05:620a:2099:b0:77d:ce42:2d4d with SMTP id e25-20020a05620a209900b0077dce422d4dmr4891001qka.2.1701361075711; Thu, 30 Nov 2023 08:17:55 -0800 (PST) Received: from redhat.com (2603-7000-9500-34a5-0000-0000-0000-1db4.res6.spectrum.com. [2603:7000:9500:34a5::1db4]) by smtp.gmail.com with ESMTPSA id ay11-20020a05620a178b00b0077dbdc40458sm622681qkb.1.2023.11.30.08.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 08:17:55 -0800 (PST) Date: Thu, 30 Nov 2023 11:17:53 -0500 From: Marek Polacek To: Florian Weimer Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH v3 09/11] c: Turn -Wreturn-mismatch into a permerror Message-ID: References: <2a00ce2d44edbda185460d72519a879fbac9bf59.1700473918.git.fweimer@redhat.com> <87cyw0ba7x.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 In-Reply-To: <87cyw0ba7x.fsf@oldenburg.str.redhat.com> User-Agent: Mutt/2.2.9 (2022-11-12) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Thu, Nov 23, 2023 at 07:22:58PM +0100, Florian Weimer wrote: > * Marek Polacek: > > > On Mon, Nov 20, 2023 at 10:56:30AM +0100, Florian Weimer wrote: > >> gcc/ > >> > >> * doc/invoke.texi (Warning Options): Document changes. > > > > That's pretty vague :). How about "Document that -Wreturn-mismatch is a > > permerror in C99."? > > Applied (with “in C99 and later”). > > >> * gcc.target/powerpc/conditional-return.c: Compile with > >> -fpermissive due to expected -Wreturn-mismatch error. > > > > There seem to be some extra whitespaces after "expected". > > Fixed. > > >> @@ -7375,7 +7376,10 @@ Attempting to use the return value of a non-@code{void} function other > >> than @code{main} that flows off the end by reaching the closing curly > >> brace that terminates the function is undefined. > >> > >> -This warning is specific to C and enabled by default. > >> +This warning is specific to C and enabled by default. In C99 and later > >> +language dialects, it is treated as an error. It an be downgraded > > > > an -> can > > Fixed. > > >> diff --git a/gcc/testsuite/gcc.target/powerpc/conditional-return.c b/gcc/testsuite/gcc.target/powerpc/conditional-return.c > >> index 6b3ef5f52ca..c6491216752 100644 > >> --- a/gcc/testsuite/gcc.target/powerpc/conditional-return.c > >> +++ b/gcc/testsuite/gcc.target/powerpc/conditional-return.c > >> @@ -1,7 +1,7 @@ > >> /* Check that a conditional return is used. */ > >> > >> /* { dg-do compile } */ > >> -/* { dg-options "-O2 -w" } */ > >> +/* { dg-options "-O2 -fpermissive -w" } */ > >> > >> /* { dg-final { scan-assembler {\mbeqlr\M} } } */ > >> > > > > These seem fine. > > > > Should we have a test for -Wno-error=return-mismatch and -Wno-return-mismatch? > > I didn't see those. > > See gcc/testsuite/gcc.dg/permerror-noerror.c and > gcc/testsuite/gcc.dg/permerror-nowarning.c. They don't show up in the > patch because the diagnostics don't change. Ah, I see that now. This patch is OK then. Thanks. Marek