From 3168d9aa5983c2dbdc4c8a26a9e0a4b23fb2d178 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 17 May 2011 17:58:26 +0200 Subject: [PATCH] Clarify docs wrt. table initializer handling for VLA/VLS. --- doc/ext_ffi_semantics.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/ext_ffi_semantics.html b/doc/ext_ffi_semantics.html index 624f9efe..56ea58b2 100644 --- a/doc/ext_ffi_semantics.html +++ b/doc/ext_ffi_semantics.html @@ -506,6 +506,11 @@ with the consecutive table elements, starting at either index all the remaining elements. Otherwise all remaining uninitialized elements are filled with zero bytes. +
  • The above logic only applies to arrays with a known fixed size. +A VLA is only initialized with the element(s) given in the table. +Depending on the use case, you may need to explicitly add a +NULL or 0 terminator to a VLA.
  • +
  • If the table has a non-empty hash part, a struct/union is initialized by looking up each field name (as a string key) in the table. Each non-nil value is @@ -518,7 +523,7 @@ or [1]. This process stops at the first nil table element.
  • Uninitialized fields of a struct are filled with zero -bytes.
  • +bytes, except for the trailing VLA of a VLS.
  • Initialization of a union stops after one field has been initialized. If no field has been initialized, the union is