-
Notifications
You must be signed in to change notification settings - Fork 0
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
runtime, tests: require -Werror=strict-prototypes
so every function has a prototype
#483
base: main
Are you sure you want to change the base?
Conversation
90727a5
to
04100a6
Compare
The change itself looks fine though I don't understand why generating C call gates requires this flag across the codebase rather than just the call gate source file. I'm also not sure how you planned on getting type declarations for C call gates so I might be missing something. |
It doesn't; it only requires them for the call gate sources as you said, but it seems a lot simpler to enforce this way, and seems like a better default in general, so I just did it everywhere.
I'm getting them from the |
I think the fewer requirements we have in terms of compiler flags the better
yeah that's the main issue I was asking about |
How are we determining the ABI for untyped |
We currently treat |
This is done by pushing the param regs onto the stack in the prologue (if there's a post condition function), and then popping them before we call the post condition function. Next we'll work on supporting more than the 6 param regs, as well as passing the return value.
…ich isn't supported yet This is a fatal error (ICE) since the caller can just set `--no-enable-dav1d_get_picture-post-condition`.
…g `pushq`s from `emit_prologue`
… has a prototype In order to have C callgate wrappers, we need to know function prototypes, but `ReturnType foo()` functions have no prototype, as `foo(void)` is required. ABI determination (and soon to be API, too) is done eagerly for all functions, so this errors when a function has no prototype. We can later relax this to only requiring prototypes on functions with callgates. Furthermore, often projects enable `-Werror=strict-prototypes` themselves, like `dav1d`. Turning this on here for the IA2 runtime and tests means that we don't have to disable it in other projects like `dav1d`.
1dcaf11
to
5eaa9bc
Compare
04100a6
to
657aafb
Compare
In order to have C callgate wrappers, we need to know function prototypes, but
ReturnType foo()
functions have no prototype, asfoo(void)
is required.ABI determination (and soon to be API, too) is done eagerly for all functions, so this errors when a function has no prototype. We can later relax this to only requiring prototypes on functions with callgates.
Furthermore, often projects enable
-Werror=strict-prototypes
themselves, likedav1d
. Turning this on here for the IA2 runtime and tests means that we don't have to disable it in other projects likedav1d
.