-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STD lib identification wrong #237
Comments
Ah, thanks for catching that. It's an interesting one because that code should not work in C (it would in C++). As part of the function replacement process it should check if the function is already defined before replacing the definition. |
Also, we can create link between "library - functions" and if we use library so we cannot add import and replace function, but like I understood - it is long way. For example $ clang -MM -c exit.c
exit.o: exit.c tests.h or full list $ clang -M -c exit.c
exit.o: exit.c /usr/include/stdlib.h /usr/include/features.h \
/usr/include/stdc-predef.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \
/usr/include/x86_64-linux-gnu/bits/wordsize.h \
/usr/include/x86_64-linux-gnu/gnu/stubs.h \
/usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/stddef.h \
/usr/include/x86_64-linux-gnu/bits/waitflags.h \
/usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
/usr/include/x86_64-linux-gnu/bits/endian.h \
/usr/include/x86_64-linux-gnu/bits/byteswap.h \
/usr/include/x86_64-linux-gnu/bits/types.h \
/usr/include/x86_64-linux-gnu/bits/typesizes.h \
/usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
/usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
/usr/include/x86_64-linux-gnu/sys/select.h \
/usr/include/x86_64-linux-gnu/bits/select.h \
/usr/include/x86_64-linux-gnu/bits/sigset.h \
/usr/include/x86_64-linux-gnu/bits/time.h \
/usr/include/x86_64-linux-gnu/sys/sysmacros.h \
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
/usr/include/alloca.h \
/usr/include/x86_64-linux-gnu/bits/stdlib-float.h tests.h \
/usr/include/string.h /usr/include/xlocale.h /usr/include/math.h \
/usr/include/x86_64-linux-gnu/bits/math-vector.h \
/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \
/usr/include/x86_64-linux-gnu/bits/huge_val.h \
/usr/include/x86_64-linux-gnu/bits/huge_valf.h \
/usr/include/x86_64-linux-gnu/bits/huge_vall.h \
/usr/include/x86_64-linux-gnu/bits/inf.h \
/usr/include/x86_64-linux-gnu/bits/nan.h \
/usr/include/x86_64-linux-gnu/bits/mathdef.h \
/usr/include/x86_64-linux-gnu/bits/mathcalls.h See more detail in https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Preprocessor-Options.html#Preprocessor-Options flag -M:
|
Thats great information. It may also come in handy when we are processing multiple input files. |
If we transpile next C code:
We see function
acos
look like from standart library -<math.h>
and with indentical signature.Result:
function
acos
are lost.The text was updated successfully, but these errors were encountered: