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.129.124]) by sourceware.org (Postfix) with ESMTPS id 653CF389839C for ; Fri, 7 Oct 2022 13:53:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 653CF389839C 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=1665150799; 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:in-reply-to:in-reply-to: references:references; bh=N3yzcy5JS0cAv5kUeEsDJyRp4UR/Sd4LjMtOuLh9ljM=; b=GGhpvQg4fHgw3+ZioRf8EDe/dZBx/BMnCCwCBTBt58t0ghQrIAjfpuiI3eaCn+0V1B5T/e 3x+JLTZdhMF4XunJ/FKEAne6Ex2QEL5ckm8DgQoFF+n1Ei+OB7G4KJP1hlym0YfoGONRFd Cp9RkWIKn/BbarFtLxinZQlgnmtPU0Y= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659-Es1F9-54O4q7J4F6qlUGLQ-1; Fri, 07 Oct 2022 09:53:16 -0400 X-MC-Unique: Es1F9-54O4q7J4F6qlUGLQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD59429AA381; Fri, 7 Oct 2022 13:53:15 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59D659D483; Fri, 7 Oct 2022 13:53:15 +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 297DrCsI3658543 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 7 Oct 2022 15:53:12 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 297DrATR3658541; Fri, 7 Oct 2022 15:53:10 +0200 Date: Fri, 7 Oct 2022 15:53:10 +0200 From: Jakub Jelinek To: Jason Merrill Cc: Jonathan Wakely , "gcc@gcc.gnu.org" , arsen@aarsen.me, "Joseph S. Myers" Subject: Re: Handling of main() function for freestanding Message-ID: Reply-To: Jakub Jelinek References: <44594c0c-db9d-459a-7ecc-29c4f5544b28@redhat.com> <2489d88a-e80b-2f89-bac5-07c0b70bc175@redhat.com> MIME-Version: 1.0 In-Reply-To: <2489d88a-e80b-2f89-bac5-07c0b70bc175@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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 Fri, Oct 07, 2022 at 09:51:31AM -0400, Jason Merrill wrote: > > There are some tests that fail if we do that. For whatever reason, > > they're checking the current semantics. > > > * gcc.dg/c11-noreturn-4.c: Add -fno-builtin-main to options. > > * gcc.dg/inline-10.c: Likewise. > > IMO we still shouldn't emit these pedwarns when freestanding, we shouldn't > require people to add another flag to avoid them. > > Adding the implicit return 0 unconditionally doesn't mean we also need to > adopt all the other special treatment of main. > > And I guess we shouldn't implicitly return 0 if the function is declared > noreturn. > > > * gcc.dg/noreturn-4.c: Likewise. > > I'd be inclined to drop this test. Ok. > > Arsen implemented Jakub's suggestion which is to add the implicit > > return by default, but add -fno-builtin-main to restore the previous > > behaviour. Is that acceptable? If not, can you and Jakub reach > > consensus so that Arsen knows what to do instead? > > His -fno-builtin-main patch is at > > https://gcc.gnu.org/pipermail/gcc-patches/2022-September/602644.html > > (This is the only one of his patch series not committed, and results > > in 100s of FAILs for libstdc++ when testing with -fffreestanding). Jakub