newlib vs C99 math functions

Jeff Johnston jjohnstn@redhat.com
Mon Aug 14 19:32:00 GMT 2006


Christopher Faylor wrote:
> On Thu, Aug 10, 2006 at 03:49:01PM -0500, mwoehlke wrote:
> 
>>Christopher Faylor wrote:
>>
>>>On Thu, Aug 10, 2006 at 02:35:44PM -0500, mwoehlke wrote:
>>>
>>>>Andrew Pinski wrote:
>>>>
>>>>>While porting some code over to use newlib from a closed source libc,
>>>>>I ran into the problem of that newlib did not implement most of the
>>>>>C99 math functions or macros.  I ran into the problem that FP_ILOGB0
>>>>>was not defined and I was wondering if anyone is working on adding any
>>>>>of the C99 math functions to newlib?
>>>>>
>>>>>Also is there a bug system for newlib because it would be great to
>>>>>file bugs about the problems I ran into.
>>>>>
>>>>>Thanks,
>>>>>Andrew Pinski
>>>>
>>>>Well, newlib's printf() does not support "%a"/"%A" which are required by 
>>>>C99, so my observation of the C99 support at least is "spotty at best".
>>>>
>>>>Meanwhile, I'll wait anxiously to see you get any more attention from 
>>>>the 'official' folks than I've gotten so far.
>>>
>>>http://isbn.nu/0671723650
>>
>>Meh :-D
>>(You know, I think we're going to get a lot of mileage out of that...)
> 
> 
> You know it will only be a short matter of time before that is directed
> at me, right?  :-)
> 
> 
>>I apologize for getting used to the promptness of Cygwin's list. This 
>>one *does* seems dead by comparison.
>>
>>Now that we know you're here, do you know if anyone is working on adding 
>>C99-conformance to newlib? ;-)
> 
> 
> I don't think that newlib has a roadmap.  Any changes would come from
> either contributions or talking very nicely to Jeff.  Since newlib isn't
> Jeff's full-time job, I would imagine that adding major new
> functionality won't be high on his to-do list.
> 

This seems as good a place to jump in as any now that I am back from my 
vacation.

1. Newlib is not C99-compliant.  Newlib is not POSIX-compliant.
    I need to put something in the docs and README so people
    will stop posting these "Newlib is broken because it is
    missing X" messages.

    Newlib was initially written by Cygnus Solutions to support embedded
    chip ports and is C90-compliant plus extras.  Cygwin uses
    it as a base and adds/substitutes functionality on top of it.  A
    similar thing is done for RTOS.

2. There is no roadmap in place to be fully C99
    or POSIX-compliant.  Newlib is still targetted at
    embedded systems with a minimal set of syscalls.  That
    said, I have no problem with adding C99 and POSIX features
    to newlib that are helpful in getting more applications to run.
    I recently added hex floating-point support to strtod for
    example.

3. Chris is correct.  Newlib is not my job here at Red Hat.
    I currently get paid to work on Eclipse.  I do not have the time
    to undertake major standard compliance work.  Contributions are
    always welcome if they are properly licensed and are mindful
    of the other platforms that use the code.  For example, the proposed
    addition of new C99 math routines would be most welcome.

4. I can start Bugzilla, but if people are planning to open a
    stream of POSIX and C99 conformance issues, get prepared to wait.
    I have limited resources to spend in addition to my regular work.
    FWIW: I try to look at actual bugs to existing functionality ASAP.
    Usually these are errors found by Cygwin users.  I am happy to
    see more and more list users helping others with build and newbie
    problems and not just waiting for me to always reply.

-- Jeff J.



More information about the Newlib mailing list