corrode
corrode copied to clipboard
OS X/clang's math.h built-ins not supported
#include <math.h>
~/.cabal/bin/corrode ./test.c
("/usr/include/math.h": line 205): illegal undefined variable; check whether a real C compiler accepts this:
__builtin_fabsf
The header file looks like this:
__header_always_inline int __inline_isfinitef(float __x) {
return __x == __x && __builtin_fabsf(__x) != __builtin_inff();
}
I have OS X 10.11 and clang Apple LLVM version 8.0.0 (clang-800.0.38), corrode b6699fb2fa552a07c6091276285a44133e5c9789
Similar problem with #include <assert.h>
, which expands to compiler-specific builtins:
illegal undefined variable; check whether a real C compiler accepts this: __builtin_expect
FYI, I hit a bunch of these in #109
For this adding the -ffast-math
resolves it.