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
0.10.0-dev.870+65aa33319
Run zig translate-c on the following:
zig translate-c
union U { long l; double d; }; void foo(void) { union U u = (union U) 42L; }
The union cast should be translated into something like this:
var u: union_U = union_U{ .l = @as(c_long, 42) };
The union cast is translated like this, which does not compile:
var u: union_U = @as(union_U, @as(c_long, 42));
The text was updated successfully, but these errors were encountered:
translate-c: Add support for cast-to-union
cd321b6
Fixes ziglang#10955
85c3ab3
d5d92de
9716a1c
Fixes #10955
Successfully merging a pull request may close this issue.
Zig Version
0.10.0-dev.870+65aa33319
Steps to Reproduce
Run
zig translate-c
on the following:Expected Behavior
The union cast should be translated into something like this:
Actual Behavior
The union cast is translated like this, which does not compile:
The text was updated successfully, but these errors were encountered: