diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-04-28 12:38:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-28 12:38:46 +0200 |
| commit | e3ecea2e7fc6b80cc715c596105f4cf890e7e2e6 (patch) | |
| tree | f7c45a4ce06b25f608bf8ddb00843c46fbb89b68 /docs/syscall_descriptions_syntax.md | |
| parent | 0ce7569ee76fda7e5a68b0fe14c93a3e8eb7d108 (diff) | |
docs: clarify struct/union attributes in syzlang
Diffstat (limited to 'docs/syscall_descriptions_syntax.md')
| -rw-r--r-- | docs/syscall_descriptions_syntax.md | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index 74d69c113..48ffcf380 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -127,11 +127,9 @@ structname "{" "\n" Structs can have attributes specified in square brackets after the struct. Attributes are: -``` -"packed": the struct does not have paddings and has default alignment 1 -"align[N]": the struct has alignment N -"size[N]": the struct is padded up to the specified size N -``` +- `packed`: the struct does not have paddings between fields and has alignment 1; this is similar to GNU C `__attribute__((packed))`; struct alignment can be overriden with `align` attribute +- `align[N]`: the struct has alignment N and padded up to multiple of `N`; contents of the padding are unspecified (though, frequently are zeros); similar to GNU C `__attribute__((aligned(N)))` +- `size[N]`: the struct is padded up to the specified size `N`; contents of the padding are unspecified (though, frequently are zeros) ## Unions @@ -146,10 +144,8 @@ unionname "[" "\n" Unions can have attributes specified in square brackets after the union. Attributes are: -``` -"varlen": union size is not maximum of all option but rather length of a particular chosen option -"size[N]": the union is padded up to the specified size N -``` +- `varlen`: union size is the size of the particular chosen option (not statically known); without this attribute unions are statically sized as maximum of all options (similar to C unions) +- `size[N]`: the union is padded up to the specified size `N`; contents of the padding are unspecified (though, frequently are zeros) ## Resources |
