This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] In _IEEE_LIBM mode, use weak symbols instead of wrapper funcs [v2]
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: Keith Packard <keithp at keithp dot com>, "howland at LGSInnovations dot com" <howland at LGSInnovations dot com>
- Cc: nd <nd at arm dot com>, "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Tue, 25 Sep 2018 11:10:20 +0000
- Subject: Re: [PATCH] In _IEEE_LIBM mode, use weak symbols instead of wrapper funcs [v2]
Keith Packard wrote:
> Craig Howland <howland@LGSInnovations.com> writes:
>> Taking a step back, there's a higher-level question. The Newlib math libary is
>> already quite goofy with the variations in error handing, making multiple
>> flavors, etc. Is it perhaps time to give this strangeness up and just make them
>> so that they are C/POSIX compliant? This too would achieve the desired goal of
>> getting rid of the wrappers.
Agreed, I don't see a point in adding yet another additional layer of complexity when
a much better solution is to remove the existing layers.
> I would actually prefer the IEEE behavior as that doesn't return errors
> in 'errno'. I was happy to find this mode already available in the
> library as it matches what I feel are the right semantics for a deeply
> embedded system.
Yes most applications do not want or need errno support for math functions.
So the best option is to remove all the wrapper files with all the complex errno
handling which nobody actually requires. Check out what the new optimized math
functions do - there are no wrappers anymore, and errno can be supported with
zero overhead if required (unlike the existing wrappers which add a huge overhead).
So the question is, is there any reason why _IEEE_LIBM should not be the default?
Wilco