Missing declarations of long complex double transcendental functions in complex.h
Ian Abbott
abbotti@mev.co.uk
Fri Aug 28 16:09:43 GMT 2020
This problem came up on stackoverflow.com in a question about using
cos() from <tgmath.h> using newlib 3.3.0 and arm-none-eabi-gcc 9.2.1.
See https://stackoverflow.com/q/63632989/5264491
test.c:
#include <tgmath.h>
void test()
{
double x=cos(4.5);
}
$ arm-none-eabi-gcc -c test.c
In file included from test.c:1:
test.c: In function 'test':
test.c:5:14: error: 'ccosl' undeclared (first use in this function); did
you mean 'ccosh'?
5 | double x=cos(4.5);
| ^~~
test.c:5:14: note: each undeclared identifier is reported only once for
each function it appears in
test.c:5:14: error: argument 6 of '__builtin_tgmath' is not a function
pointer
It seems to be because various functions in <complex.h> are only
declared if the '__CYGWIN__' macro is defined. Note that for
arm-none-eabi, the '_LDBL_EQ_DBL' macro is defined in <newlib.h>.
Best regards,
Ian Abbott
--
-=( Ian Abbott <abbotti@mev.co.uk> || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268. Registered address: )=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
More information about the Newlib
mailing list