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 755103857364 for ; Thu, 13 Oct 2022 17:10:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 755103857364 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=1665681019; h=from:from:reply-to: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=GFfZL/v+eDJJQe4ceeD/UXbbnq9n9g6md3kzIAhqY1s=; b=RbNVaJOQf0ivsXWvl9KEzeI4/5mE2mJ9xRh1b3pEbmRq+8BtwXyID6fPQjS7LVKtnfLwJD xmPNvVT3qPdzj1nL2N0//bfQ95WT1YOWOMZSt3xjV4oZrbb0L6Gc1vwHwk1DeONKdK4+1f VTYHAmVXTqjn3xeNH0slr46TPWieJso= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-RxklDHtFMxierSr_b9An1A-1; Thu, 13 Oct 2022 13:10:16 -0400 X-MC-Unique: RxklDHtFMxierSr_b9An1A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 74B96101A528; Thu, 13 Oct 2022 17:10:15 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1BD5C1415108; Thu, 13 Oct 2022 17:10:14 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 29DHACHb655139 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 13 Oct 2022 19:10:12 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 29DHABSD655138; Thu, 13 Oct 2022 19:10:11 +0200 Date: Thu, 13 Oct 2022 19:10:10 +0200 From: Jakub Jelinek To: Arsen =?utf-8?Q?Arsenovi=C4=87?= Cc: Jonathan Wakely , gcc-patches@gcc.gnu.org, "gcc@gcc.gnu.org" , "Joseph S. Myers" , Jason Merrill Subject: Re: Handling of main() function for freestanding Message-ID: Reply-To: Jakub Jelinek References: <2489d88a-e80b-2f89-bac5-07c0b70bc175@redhat.com> <16718001.dR7co8bJll@bstg> MIME-Version: 1.0 In-Reply-To: <16718001.dR7co8bJll@bstg> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Thu, Oct 13, 2022 at 07:03:24PM +0200, Arsen Arsenović wrote: > @@ -1,10 +1,10 @@ > /* Check for "noreturn" warning in main. */ > /* { dg-do compile } */ > -/* { dg-options "-O2 -Wmissing-noreturn -ffreestanding" } */ > +/* { dg-options "-O2 -Wmissing-noreturn" } */ > extern void exit (int) __attribute__ ((__noreturn__)); > > -int > -main (void) /* { dg-warning "function might be candidate for attribute 'noreturn'" "warn for main" } */ > +void > +f (void) /* { dg-warning "function might be candidate for attribute 'noreturn'" "warn for main" } */ > { > exit (0); > } Don't we have such a test already elsewhere? If not, then certain "warn for main" part should be removed or replaced... Jakub