The functions in the builtin module produce a C compilation error as they are defined to return u8, but the C __builtin_xxx equivalents return int. The forward declaration produced results in a type mismatch.
Minimal example to reproduce:
module example;
import builtin as b;
public fn i32 main(i32 argc, char **argv) {
return b.popcount(cast<u32>(argc));
}
This gives an error with clang and a warning and link error with GCC.
The functions in the
builtinmodule produce a C compilation error as they are defined to returnu8, but the C__builtin_xxxequivalents returnint. The forward declaration produced results in a type mismatch.Minimal example to reproduce:
This gives an error with clang and a warning and link error with GCC.