-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix: mismatch method signature of libc's calloc #201
Conversation
Wooooooow gonna try it out! |
Just wondering why mismatched declaration does not lead to link failure |
Linker is only a sysmbol(function name) lookup table without any syntax check, and it supports variable-counts arguments, the caller and the callee need to strictly adhere to the constraints themselves. |
Oh, it seems a 2 levels include reference, so here rust extern C ABI conceals the real signature in libc.h. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was a bit afraid when I first saw SP1 still not working, but it seems making the function public did the trick!
https://docs.rs/libc/latest/libc/fn.calloc.html