From bdbcc050c7c2c50d33da2bc14ba861f74ec111f0 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 20 May 2022 07:10:51 -0700 Subject: doc: undimensioned arrays may be flexible array members. * txr.1: The documentation for array and zarray wrongly states that if the dimension is omitted, the type may not be used as a structure member. In fact, it may be used as the last member of a flexible structure. --- txr.1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/txr.1 b/txr.1 index e4321a84..6b2a696b 100644 --- a/txr.1 +++ b/txr.1 @@ -80304,8 +80304,11 @@ element, it denotes a variable length array. It corresponds to the concept of an incomplete array in the C language, except that no implicit array-to-pointer conversion concept is implemented in the FFI type system. This type may not -be used as an array element or structure member. It also may not +be used as an array element or structure member, other than as the +last structure member. It also may not be passed or returned by value, only by pointer. +If the last member of a structure has this type, then it is a flexible +array member; see the Flexible Structures section below. Since the type has unknown length, it has a trivial get operation which returns .codn nil . @@ -80419,9 +80422,11 @@ syntax which omits the .meta dim argument specifies a null-terminated variant of the variable-length array. Like that type, it corresponds to the concept of an incomplete -array in the C language. It may not be used as an array element -or structure member, and cannot be passed as an argument or returned -as a value. +array in the C language. It may not be used as an array element, +and may not be used as a structure member other than the last member. +It cannot be passed as an argument or returned as a value. +If the last member of a structure has this type, then it is a flexible +array member; see the Flexible Structures section below. Unlike the ordinary variable-length .codn array , -- cgit v1.2.3