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 601BE3852764 for ; Fri, 21 Oct 2022 09:17:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 601BE3852764 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=1666343864; 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=C6aGAPQ0mWVvWM+SgcS1N35ZlQNtBA8K0Og8KW8jNy4=; b=G9t/IU5wTNJV9WJEDUnNgYnCmR21V89JW4a5gAVa49/oYC/9XzkAxw4nWTlIav23wxIa6W cacZVgeOOPhiZ5DH0eSMd5JxgOdWCyV903TtNHpoBOH6w18/J8zuAjjulj0I+1m3Xvc96/ LKNEmLjqkhBxbUKwpXbNVpgYpWyqsQc= 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-554-WovDTrOzMUOnUpb42wcipA-1; Fri, 21 Oct 2022 05:17:42 -0400 X-MC-Unique: WovDTrOzMUOnUpb42wcipA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96DBD800B23 for ; Fri, 21 Oct 2022 09:17:42 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C203140ED786; Fri, 21 Oct 2022 09:17:41 +0000 (UTC) From: Florian Weimer To: Jakub Jelinek Cc: gcc@gcc.gnu.org Subject: Re: C89isms in the test suite References: <87wn8tbmdr.fsf@oldenburg.str.redhat.com> Date: Fri, 21 Oct 2022 11:17:40 +0200 In-Reply-To: (Jakub Jelinek's message of "Fri, 21 Oct 2022 10:57:48 +0200") Message-ID: <87o7u5bknf.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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: * Jakub Jelinek: > On Fri, Oct 21, 2022 at 10:40:16AM +0200, Florian Weimer via Gcc wrote: >> What should we do about these when they are not relevant to what's being >> tested? For example, gcc/testsuite/gcc.c-torture/execute/ieee/mzero6.c >> has this: >>=20 >> int main () >> { >> if (__builtin_copysign (1.0, func (0.0 / -5.0, 10)) !=3D -1.0) >> abort (); >> exit (0); >> } >>=20 >> but no include files, so abort and exit are implicitly declared. >>=20 >> Should we inject a header with -include with the most common >> declarations (which includes at least abort and exit)? Or add the >> missing #include directives? But the latter might not work for >> freestanding targets. >>=20 >> Implicit ints and function declarations without prototypes are also >> common (not just for main). >>=20 >> Other tests look like they might be intended to be built in C89 mode, >> e.g. gcc/testsuite/gcc.c-torture/compile/386.c, although it's not >> immediately obvious to me what they test. > > I think these days we at least for abort tend to use __builtin_abort (); > if we don't want to declare it (in other tests we declare it ourselves). > exit we usually don't use at all, but sometimes we handle it similarly > to abort. So we would patch the tests? I guess we can make sure we use =E2=80=9Cint = main (void)=E2=80=9D etc. at the same time. One thing we haven't discussed much so far is PR106416 (-Wint-conversion should be an error, not a pedwarn). I think I found the place in the GCC sources to patch to turn this into an error, but I haven't tried it yet to see what happens. I assume the rule is the same for the other historic stuff (accepted in C89 mode with a warning, error in C99 or later language modes). What's the expected default behavior for GCC 14 regarding old-style function definitions (function definitions which do not have a prototype)? I assume if GCC 14 defaults to C2x mode, these no longer valid constructs would be rejected by default? Based on some earlier experiments, the C2x changes for unnamed parameters is in fact compatible with GCC's existing implementation of implicit ints and old-syle function definitions: identifiers which denote a type are already rejected today and not treated as a parameter of type int. Thanks, Florian