corrode icon indicating copy to clipboard operation
corrode copied to clipboard

OS X/clang's math.h built-ins not supported

Open kornelski opened this issue 8 years ago • 2 comments

#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

kornelski avatar Dec 10 '16 12:12 kornelski

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

kornelski avatar Dec 10 '16 12:12 kornelski

FYI, I hit a bunch of these in #109

For this adding the -ffast-math resolves it.

bluejekyll avatar Jan 27 '17 20:01 bluejekyll