You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where double __exp10(unsigned x) is defined in another local file.
When translating this code you get a warning from C:
/home/dkolsoi/repos/c2rust/test.c:3:8: warning: incompatible redeclaration of library function
'__exp10' [-Wincompatible-library-redeclaration]
double __exp10(unsigned x);
^
/home/dkolsoi/repos/c2rust/test.c:3:8: note: '__exp10' is a builtin with type'double (double)'
Will fail to compile because it uses the builtin signature which takes a double and not an int.
Interestingly (but maybe not totally surprising), passing the -ffreestanding flag to clang via the transpiler will bypass this issue and use the correct signature:
Newlib does a little bit more complicated version of this:
Where
double __exp10(unsigned x)
is defined in another local file.When translating this code you get a warning from C:
But the translated code:
Will fail to compile because it uses the builtin signature which takes a double and not an int.
Interestingly (but maybe not totally surprising), passing the
-ffreestanding
flag to clang via the transpiler will bypass this issue and use the correct signature:(also interesting, but not problematic, note that it's using
x
not_
in the param sig)This can be seen in newlib when configuring with
--disable-newlib-fno-builtin
The text was updated successfully, but these errors were encountered: