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
C translator failure with void typedef #10356
Comments
|
Just to double check - did you rebuild after pulling? |
This was a fresh clone of the repo today. So it shouldn’t have anything to do with cache or the compiler as far as I’m aware. |
What system are you building it on (OS, CPU, etc)? |
OSX, M1. The Air model if that’s relevant. |
Ok, unfortunately I don't have access to an M1 mac. The only other thing I can think of is that if Zig was previously installed in some other way, an old version might be in your path and it's using that instead of the freshly built one. If that's not the case I think we'd have to find someone with an M1 mac to see if it happens for them. I can't imagine why it would only happen there though. |
I’ll double check this and get back to you. |
I just ran |
Yeah, sorry that’s my bad, my paths were messed up. Runs fine for me now. |
Zig Version
0.9.0-dev.1695+c6b4fe006
Steps to Reproduce
Add the following to two files:
main.zig:
test.h:
Attempt to compile with
zig build
(just used theinit-exe
build script with link libc linked and a include directory set to get it to find the .h file).Expected Behavior
The program should compile.
Actual Behavior
A compilation failure occurs with the error:
This is likely due to the fact that in C the singular typedef is being used for what was split into 2 things in Zig (
void
andc_void
) so it cannot possibly compile correctly in this case if it uses the aliasV
directly. Note some code does actually do this, like this project for whatever reason.The text was updated successfully, but these errors were encountered: