From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 0280E38CEFE2 for ; Fri, 21 Oct 2022 20:55:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0280E38CEFE2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.95,203,1661846400"; d="scan'208";a="85195046" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 21 Oct 2022 12:54:35 -0800 IronPort-SDR: RGHqBHBTf9c34StRIVB8iTiOZY7ryl89HcJE8uqYhLpW5Sabs2ZFvlbCZLJuWk5uDBVjU/Y2s4 7WY2McAXoNm9aTSbhqIjXImyrrz65gHQgAbuuIScRzUgzApNvInuYunqlB4bUF5DO1Fka9Ek9E WjV73cdYl/f6ZLVIvjcsrKrsl4m+QWTmxE9Izgx+yG+D1dyEnso4wX41u4wSAIeUBpNel1YYuU Y2qVpNxuWmwEMwdmzAyfEZVsVpfqQtEndxg6NaVF3wigo6oGPVKEveKhEhXvRA5uC9M4c1V1Gy WxE= Date: Fri, 21 Oct 2022 20:54:30 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Florian Weimer CC: Subject: Re: C89isms in the test suite In-Reply-To: <87wn8tbmdr.fsf@oldenburg.str.redhat.com> Message-ID: References: <87wn8tbmdr.fsf@oldenburg.str.redhat.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3110.5 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no 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, 21 Oct 2022, 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: > > int main () > { > if (__builtin_copysign (1.0, func (0.0 / -5.0, 10)) != -1.0) > abort (); > exit (0); > } > > but no include files, so abort and exit are implicitly declared. > > 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. If it's clear the test is testing something other than those implicit function declarations, either declaring the functions or using __builtin_exit and __builtin_abort seems reasonable. > Implicit ints and function declarations without prototypes are also > common (not just for main). > > 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. For tests that might be deliberately testing implicit function declarations or unprototyped functions, it's probably better to use explicit options that avoid errors (note that the c-torture tests already use -w to disable all warnings). -- Joseph S. Myers joseph@codesourcery.com