-
Notifications
You must be signed in to change notification settings - Fork 79
convert tool omitting return type ptr when using pthread #623
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
Comments
I was able to reduce my example to this: Original C code:
|
The convert tool has been mostly rewritten. Please reopen if this is still an issue. |
The convert tool has been mostly rewritten (see PR #642). Please reopen this issue if it still exists. |
1 similar comment
The convert tool has been mostly rewritten (see PR #642). Please reopen this issue if it still exists. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed this issue when converting the Icecast code. In the file
src/thread/thread.c
the function:static void *_start_routine(void *arg)
is incorrectly converted to:void _start_routine(void *arg : itype(void* ) ) : itype(void* ) ;
I created a small example that highlights the issue:
Original C code
ptr_ex.c
:I compiled this code with gcc with no issues:
gcc ptr_ex.c -lpthread
checked-c-convert
output:Note: I added
#include <stdio_checked.h>
and#include <stdlib_checked.h>
before I ran the toolNote that the return type for
print_message_function()
is changed fromstatic void *
tovoid
, but the CheckedC return type is stillitype(void* )
I could only replicate this issue when using
pthread_create()
. I have observed it in other parts of the Icecast code. Namely when convertingsrc/httpp/httpp.c
andsrc/cfgfile.c
. In all cases theitype()
has the correct return type, while the C return type omits the*
The text was updated successfully, but these errors were encountered: