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 6D1BC3858C31 for ; Thu, 23 Nov 2023 18:23:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D1BC3858C31 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 6D1BC3858C31 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=1700763783; cv=none; b=OhQ/LLTwMDi4+eitLCBD634z5rPAIHZwBDkmaqcE3UhArl89IJv3oJdNoB0c6PAZHQkeY3izb97dx/qoU2/ge4mTHP2vk0AbA/D1O5Zul7O3dPkaXoTKwlmukQjEa9nC0Oth3MXzx+djtb4J/JOhHulyrlXeDJSHyzu5Tp+yJiA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700763783; c=relaxed/simple; bh=58Ctb8RPX79TfzMhSPO/TzDSOwpWnrHqSBMgQCkbs8A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HDmhfIvoppk+XxceV1w1DrfQHszPfQw9vsiq7k+aVFkrJlrb9IpMy4ALkHExKIGYPHQ2LdZNKjgVSqkuFNvZXR78s2p2VOhjBDEbvnc1H32ULNvYYSXbuJWO2rECgCRPb+gkjuIAVs+ezAmHEUAXGwSOP6eObLKWbNA38biugBY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700763782; 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=8OmfKK5rqxz15wuNR/SoYwDoufTHJ1uLSb9gxIRwNQ4=; b=d0p/nnDTHyyJAyMHDVfhlssnTJjCyOZQoOqNKTOwbnQn5icPQKCq19cNSN5P14wJhvthMb 9G1f+2zpxqb9hPYUIXCVYmvu8fhausu8lJNeA+m+Z8XX6wkHK6OftRL9olfjhJ7OUW7ggO zlAu0hV4EWBNnc5hayit9rvDQIT4rDg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-440-ks3xRRLnOfSrnKKN-smyLw-1; Thu, 23 Nov 2023 13:23:00 -0500 X-MC-Unique: ks3xRRLnOfSrnKKN-smyLw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8AE73811E82 for ; Thu, 23 Nov 2023 18:23:00 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.108]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA5081C060B0; Thu, 23 Nov 2023 18:22:59 +0000 (UTC) From: Florian Weimer To: Marek Polacek Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH v3 09/11] c: Turn -Wreturn-mismatch into a permerror References: <2a00ce2d44edbda185460d72519a879fbac9bf59.1700473918.git.fweimer@redhat.com> Date: Thu, 23 Nov 2023 19:22:58 +0100 In-Reply-To: (Marek Polacek's message of "Thu, 23 Nov 2023 12:32:43 -0500") Message-ID: <87cyw0ba7x.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.6 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,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: * Marek Polacek: > On Mon, Nov 20, 2023 at 10:56:30AM +0100, Florian Weimer wrote: >> gcc/ >>=20 >> =09* doc/invoke.texi (Warning Options): Document changes. > > That's pretty vague :). How about "Document that -Wreturn-mismatch is a > permerror in C99."? Applied (with =E2=80=9Cin C99 and later=E2=80=9D). >> =09* gcc.target/powerpc/conditional-return.c: Compile with >> =09-fpermissive due to expected=09-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. >> =20 >> -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. */ >> =20 >> /* { dg-do compile } */ >> -/* { dg-options "-O2 -w" } */ >> +/* { dg-options "-O2 -fpermissive -w" } */ >> =20 >> /* { dg-final { scan-assembler {\mbeqlr\M} } } */ >> =20 > > These seem fine. > > Should we have a test for -Wno-error=3Dreturn-mismatch and -Wno-return-mi= smatch? > 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. Thanks, Florian