We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I came across this issue when converting Icecast in the function thread_create_c() in the src/thread/thread.c file.
Icecast
thread_create_c()
src/thread/thread.c
When calloc() is used to allocate memory the tool will make the assigned pointer a wild pointer, even if it should be a _Ptr
calloc()
_Ptr
The following is a small example that illustrates the issue: bar.c: (with malloc())
bar.c
malloc()
#include <stdlib_checked.h> int main() { char *ptr1 = NULL; ptr1 = (char *) malloc(sizeof(char)); return 0; }
After the conversion, it will produce: bar.checked.c:
bar.checked.c
#include <stdlib_checked.h> int main() { _Ptr<char> ptr1 = NULL; ptr1 = (char *) malloc(sizeof(char)); return 0; }
Now with calloc() bar.c: (with calloc())
#include <stdlib_checked.h> int main() { char *ptr1 = NULL; ptr1 = (char *) calloc(1, sizeof(char)); return 0; }
The porting tool will not make any changes to this file.
Expected output:
#include <stdlib_checked.h> int main() { _Ptr<char> ptr1 = NULL; ptr1 = (char *) calloc(1, sizeof(char)); return 0; }
The text was updated successfully, but these errors were encountered:
Fixing the allocator issue, #8
b2d8f0d
Fixed.
Sorry, something went wrong.
a8e9dc4
dev-fixes
No branches or pull requests
I came across this issue when converting
Icecast
in the functionthread_create_c()
in thesrc/thread/thread.c
file.When
calloc()
is used to allocate memory the tool will make the assigned pointer a wild pointer, even if it should be a_Ptr
The following is a small example that illustrates the issue:
bar.c
: (withmalloc()
)After the conversion, it will produce:
bar.checked.c
:Now with
calloc()
bar.c
: (withcalloc()
)The porting tool will not make any changes to this file.
Expected output:
The text was updated successfully, but these errors were encountered: