From a339951e5f3c045290340330bcea3ff4155b8334 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 2 Mar 2018 14:26:58 +0100 Subject: pkg/compiler: add size attribute for structs The size attribute allows to pad a struct up to the specified size. --- docs/syscall_descriptions_syntax.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'docs/syscall_descriptions_syntax.md') diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index 82de2f220..42a6439dd 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -102,10 +102,19 @@ Structs are described as: ``` structname "{" "\n" (fieldname type "\n")+ -"}" +"}" ("[" attribute* "]")? ``` -Structs can have trailing attributes `packed` and `align_N`, they are specified in square brackets after the struct. +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": the struct is padded up to the specified size +``` + +attribute ## Unions -- cgit mrf-deployment