From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60230 invoked by alias); 21 Jun 2017 15:09:59 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 60220 invoked by uid 89); 21 Jun 2017 15:09:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Craig, joel, H*f:sk:cf62efd, H*i:sk:cf62efd X-HELO: OARmail.OARCORP.com Received: from oarmail.oarcorp.com (HELO OARmail.OARCORP.com) (67.63.146.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Jun 2017 15:09:57 +0000 Received: from [192.168.1.168] (192.168.1.168) by OARmail.OARCORP.com (192.168.2.2) with Microsoft SMTP Server (TLS) id 8.3.389.2; Wed, 21 Jun 2017 10:09:49 -0500 Subject: Re: Importing cacoshl.c and its dependent methos, To: Craig Howland , "newlib@sourceware.org" References: <0205aa55-7b80-245d-0af6-4fe67c15429f@embedded-brains.de> <20170621082825.GD6658@calimero.vinschen.de> From: Joel Sherrill Message-ID: <356dfbd5-08e0-e8e9-6c7e-b9bb8c2b0cef@oarcorp.com> Date: Wed, 21 Jun 2017 15:09:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017/txt/msg00448.txt.bz2 On 6/21/2017 10:02 AM, Craig Howland wrote: > On 06/21/2017 08:04 AM, aditya upadhyay wrote: >> So ,To not rely on stdbool.h from c99, do i have to port stdbool.h here also ? >> Otherwise we can use >> #ifndef __cplusplus >> typedef enum { false, true } bool; >> #endif >> >> Thanks a lot for your suggested modification. I am applying the >> required the modification. >> >> Regards, >> Aditya Upadhyay >> >> On Wed, Jun 21, 2017 at 1:58 PM, Corinna Vinschen wrote: >>> On Jun 21 08:46, Sebastian Huber wrote: >>>> On 21/06/17 04:24, aditya upadhyay wrote: >>>> >>>>> Hello Developers, >>>>> In cacoshl.c, There is a dependency between cacoshl.c and csqrtl.c. >>>>> In ported csqrtl.c from NetBSD, stdbool.h is there, But i saw there >>>>> is no stdbool.h. >>>>> >>>>> So for bool data type, I have used enum. Is it a right way or not. >>>>> please suggest or do i have to use stdbool.h from gcc library ? >>>> is currently not used by Newlib. I am not sure if we should add >>>> this dependency if its only needed by csqrtl.c (in overall NetBSD libm) and >>>> not visible to the user. >>>> >>>> I would replace the #include with >>>> >>>> #ifndef __cplusplus >>>> typedef enum { false, true } bool; >>>> #endif >>>> >>>> and keep the rest of the code unchanged. >>> Wait. Isn't stdbool.h available in gcc for ages? When building newlib, >>> shouldn't we be able to rely on c99 being available? >>> >>> >>> Corinna >>> > Yes, we can, and should. That's because complex.h and stdbool.h were added in > C99, making C99 required for these functions. I did a quick check on some older > cross-compiler installs that I have, and GCC 4.1.1 has stdbool.h (and 4.6.4 has > complex.h). Just to clarify, I did a test and added include to printf.c. It worked and picked up the gcc version. Can we rely on this being present or does newlib need to have its own? I want to make sure the direction is quite clear. :) --joel > Craig >