Missing declarations of long complex double transcendental functions in complex.h

Ian Abbott <[email protected]>
Newsgroups gmane.comp.lib.newlib
Organization MEV Ltd.
Message-ID <[email protected]>
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 <[email protected]> || 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. )=-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.