mstorsjo / llvm-mingw

An LLVM/Clang/LLD based mingw-w64 toolchain
Other
1.98k stars 188 forks source link

error: call to undeclared function '_j1' #432

Open kasper93 opened 5 months ago

kasper93 commented 5 months ago

Source code

#include <math.h>

double foo(double a) {
    return _j1(a);
}

Expected Behavior

$ clang --version
clang version 17.0.3
Target: x86_64-pc-windows-msvc
$ clang --std=c17 -c c.c

Actual Behavior

$ clang --version
clang version 18.1.6
Target: x86_64-w64-windows-gnu
$ clang --std=c17 -c c.c
c.c:4:12: error: call to undeclared function '_j1'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    4 |     return _j1(a);
      |            ^
1 error generated.

Those functions are declared behind #ifndef __STRICT_ANSI__, why?

mati865 commented 5 months ago

There is an upstream patch https://sourceforge.net/p/mingw-w64/mailman/message/58782943/ propose like it was said on IRC.