Skip to content
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

Make test run by default, avoid *void function cast error #108

Open
wants to merge 1 commit into
base: 0.7.x
Choose a base branch
from

Conversation

janbiedermann
Copy link

No description provided.

@boazsegev
Copy link
Owner

I like that we can avoid the warning... but... do we really want to avoid the warning?

Wouldn't it be better to have explicit code (i.e. (void*)(intptr_t)(func)) rather than miss instances where this comment actually reveals an unintended cast?

I think finding any warnings in the code would be better 🤔?

@janbiedermann
Copy link
Author

Nono, its not avaoiding the warning, its avoiding the error. The error makes compilation stop. I guess this is since gcc 9 or so with -pedantic, having these casts is a problem. There is no simple solution, even casting will print a warning/error so this just makes it print the warning and compilation succeed. It really needs another solution, like VAARGS or args with the relevant types.

@boazsegev
Copy link
Owner

I think I will need to test alternatives before I disable a warning that might actually indicate an unintended error.

I was pretty sure an explicit "chain" casting using uintptr_t can be used to prevent these types of warnings by informing the compiler that this cast is intentional (i.e., (int (*)(int)(intptr_t)fn)... but maybe I missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants