From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: newlib@sourceware.org
Subject: Re: Importing cacoshl.c and its dependent methos,
Date: Mon, 26 Jun 2017 06:05:00 -0000 [thread overview]
Message-ID: <3f8caf5f-ed3a-515d-0cac-67280486ce59@embedded-brains.de> (raw)
In-Reply-To: <cf62efd3-73cb-ef54-659e-81c2e1b24d5b@LGSInnovations.com>
On 21/06/17 17:02, 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
>> <vinschen@redhat.com> 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 ?
>>>> <stdbool.h> 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 <stdbool.h> 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).
> Craig
Yes, since <complex.h> is C99 it makes sense to use <stdbool.h> as well.
In GCC the <stdbool.h> is available since 1998.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
prev parent reply other threads:[~2017-06-26 6:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 2:25 aditya upadhyay
2017-06-21 6:46 ` Sebastian Huber
2017-06-21 8:28 ` Corinna Vinschen
2017-06-21 12:05 ` aditya upadhyay
2017-06-21 15:02 ` Craig Howland
2017-06-21 15:09 ` Joel Sherrill
2017-06-21 15:18 ` Craig Howland
2017-06-26 6:05 ` Sebastian Huber [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f8caf5f-ed3a-515d-0cac-67280486ce59@embedded-brains.de \
--to=sebastian.huber@embedded-brains.de \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).