]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
doc: Add explanation of zero-length array example
authorJonathan Wakely <jwakely@redhat.com>
Wed, 26 Apr 2023 16:09:36 +0000 (17:09 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 27 Apr 2023 08:55:56 +0000 (09:55 +0100)
gcc/ChangeLog:

* doc/extend.texi (Zero Length): Describe example.

gcc/doc/extend.texi

index ac476801ed84dcbd1e714fde9288ba394021177b..e426a2eb7d81fed7ab838d931aaa71e3e56579df 100644 (file)
@@ -1705,6 +1705,9 @@ struct line *thisline = (struct line *)
 thisline->length = this_length;
 @end smallexample
 
+In this example, @code{thisline->contents} is an array of @code{char} that
+can hold up to @code{thisline->length} bytes.
+
 Although the size of a zero-length array is zero, an array member of
 this kind may increase the size of the enclosing type as a result of tail
 padding.  The offset of a zero-length array member from the beginning