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 0DF533857C4D for ; Thu, 20 Aug 2020 22:43:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0DF533857C4D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: +s8JqYdWqjoslrUk+SKhIVJm2n4exiFCdA5Kj4JoUn9WcUBgt+afw/PuFsM001SLjrH7uyddLC 01AHqQzptUd1MLed5D6zyoL4iE5jcJYJBPvStcHAdcxZYgzCj1sx7LHWDVKo4Agq72EC65Lqit rGuQxBFkkpwAMkfy52MvzAPVEnM0p3RayffAxR1K5GRMWceWs2kYeFiVYdRjERjZee1U6MmhR2 6t81NzVpd/DDpqTI5GGZx+CtNfzO1YNWHs/Q1cOP7GQWbSOdC3lkKGXVPYxwuMQi1ob4JmOXF8 3WA= X-IronPort-AV: E=Sophos;i="5.76,334,1592899200"; d="scan'208";a="52240300" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 20 Aug 2020 14:43:28 -0800 IronPort-SDR: jSCSQECH08OxH0NqBQBXt3X60prnkyjNRGVdwN/LYa2iob3YKgTXUNKp3Qd7Ko7ZxcSIpVx6tg 6Y+jO9IP1f610ce/bxlYjO/hLQK6LpJCzsyxKzC19vmu4GzWxcNO5hh8FE1yHkKg2G9yHa7odo 9ZmiIUn8qqQy9RLdZU0qurUJBZYSCmR1F+wSHqRt2IRzjnig2Nxpd/O04U3gNnNA08Aomyg9y/ QLCkldUdfh8M0fgAzbi5oSyuLnngeqDlmnHBEoIAD9hvtJhOy/MCD3OTn4Q0QI4ORaIgVwcBGM 57A= Date: Thu, 20 Aug 2020 22:43:23 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Keith Packard CC: Subject: Re: [PATCH 3/6] Avoid implicit floating point conversions In-Reply-To: <20200820221449.686006-4-keithp@keithp.com> Message-ID: References: <20200820221449.686006-1-keithp@keithp.com> <20200820221449.686006-4-keithp@keithp.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-08.mgc.mentorg.com (139.181.222.8) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-Spam-Status: No, score=-3132.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2020 22:43:30 -0000 On Thu, 20 Aug 2020, Keith Packard via Newlib wrote: > diff --git a/newlib/libc/include/complex.h b/newlib/libc/include/complex.h > index 0a3ea97ed..13b300021 100644 > --- a/newlib/libc/include/complex.h > +++ b/newlib/libc/include/complex.h > @@ -9,8 +9,10 @@ > #define _COMPLEX_H > > #define complex _Complex > -#define _Complex_I 1.0fi > +#define _Complex_I 1.0i > +#define _Complex_If 1.0if > #define I _Complex_I > +#define I_f _Complex_If This is contrary to the standard requirement that _Complex_I and I have type const float _Complex. > # ifndef INFINITY > -# define INFINITY (__builtin_inff()) > +# define INFINITY (__builtin_inf()) > +# endif This is contrary to the standard requirement that INFINITY has type float. > # ifndef NAN > -# define NAN (__builtin_nanf("")) > +# define NAN (__builtin_nan("")) > +# endif This is contrary to the standard requirement that NAN has type float. > #ifndef NO_ERRNO > - if (isinf (retval) && !isinf (val)) > + if (isinff (retval) && !isinff (val)) isinf, isnan, etc. are *type-generic* macros. If newlib is declaring them in a non-type-generic way, that should be fixed, rather than changing users to use a type-specific function. -- Joseph S. Myers joseph@codesourcery.com