-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Documentation for 'align' Does Not Include Bitfield Alignment #14361
Copy link
Copy link
Open
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.docsenhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.
Milestone
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.docsenhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Zig Version
0.11.0-dev.3+0bbb00035
Steps to Reproduce and Observed Behavior
The documentation for the 'align' keyword (section 13.2 of the Zig Language Reference) only covers the syntax for setting byte alignment.
However, section 15.3 'packed struct' shows that another syntax is valid, with an error message giving a hint on its meaning.
This example program also uses this syntax for align:
I don't see any indication that this syntax is valid, or how to use it, in the current documentation.
This came up with my project zig_tcl when dealing with bit aligned fields across a C API boundary, and I don't know how to proceed without a better understanding of alignment in Zig.
Expected Behavior
I expect documentation for the 'align' keyword to include this, seemingly valid, use of the keyword.