arm fenv support - static inline of methods

Richard Damon Richard@Damon-Family.org
Wed May 13 21:03:41 GMT 2020


On 5/13/20 2:17 PM, Brian Inglis wrote:
> On 2020-05-13 08:11, Joel Sherrill wrote:
>
>> Eshan Dhawan is an RTEMS GSoC 2020 student working on adding more POSIX
>> methods to RTEMS and newlib if appropriate. He is currently looking at
>> adding more
>> fenv.h implementations.
>>
>> The FreeBSD implementation of arm fenv.h has static inlines for all the
>> methods in sys/fenv.h. Is this OK? Or should they be turned into real
>> bodies in a C file?
> Don't all functions need to be provided as linkable implementations for cases
> where they are invoked using their address directly or indirectly, unless the
> standards agree they don't need to be?
>
But you CAN take the address of a static inline function, and then call
through that address. Taking the address will force the compiler to
generate an out of line copy to take the address of it. What this
doesn't allow is manually providing a prototype per the standard and
calling it, but I am not sure that is officially required to be
supported in the standard.

-- 
Richard Damon



More information about the Newlib mailing list