[PATCH] Fix math transformation on targets without c99 math functions
Szabolcs Nagy
szabolcs.nagy@arm.com
Thu Jan 14 15:39:00 GMT 2016
On 14/01/16 15:02, Andre Vieira (lists) wrote:
> Unfortunately c99_functions is a very wide net. For instance, newlib supports the ceill, but doesn't support
> wscanf_s nor any bounds checking function I think.
>
wscanf_s is not c99
(it is in the optional annex k of c11, which is
likely to be removed from the standard)
> I extracted all function names from the C99 standard and did a quick nm and grep to look into whether newlib
> defined these for arm-none-eabi.
>
> The functions I found missing fall into the following sections:
> - Complex Arithmetic (which fall under the function_c99_math_complex class)
that's ok to skip (complex become optional in c11)
> - floating-point environment
> - Functions for greatest-width integer types
these are not ok to skip from c99
> - atomics (missing atomic_is_lock_free and atomic_fetch_key)
> - Bounds-checking interfaces
>
these are optional c11 features
> I don't quite know how to proceed. I suspect a new function class for C99 math functions (excluding complex)
> would help here and probably more places too. Though, I don't know how much work it would be to split
> function_c99_misc in that manner.
>
> Opinions welcome!!
i think newlib should implement the missing c99 apis
otherwise don't expect any c99 optimizations
(and should be considered broken with -std=c99 or higher)
More information about the Gcc-patches
mailing list