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
This program displays 4 for the offset of b, where I am expecting it to be 16.
Linux localhost 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1 (2019-04-12) x86_64 GNU/Linux 0.4.0+381c6a38 const std = @import("std"); const S = packed struct { a: u32, pad: [3]u32, b: u32 }; pub fn main() anyerror!void { var offset: usize = @byteOffsetOf(S, "b"); std.debug.warn("offset {}\n", offset); }
The text was updated successfully, but these errors were encountered:
Related: #2627
Sorry, something went wrong.
Yeah this is a duplicate of the issue linked by @timonkruiper I found a little while ago, where the total size of the struct is also wrong.
No branches or pull requests
This program displays 4 for the offset of b, where I am expecting it to be 16.
The text was updated successfully, but these errors were encountered: