aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-04-26 17:09:36 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-04-27 09:55:56 +0100
commit429c72eb632040bacef9569b6d783d72fee93b42 (patch)
tree18352460e43a09185c0253603e217f1c4f6e7b1a
parent7bcdcf86e8272eeb524cc1dcb0ada8c8cfe6f27e (diff)
downloadgcc-429c72eb632040bacef9569b6d783d72fee93b42.zip
gcc-429c72eb632040bacef9569b6d783d72fee93b42.tar.gz
gcc-429c72eb632040bacef9569b6d783d72fee93b42.tar.bz2
doc: Add explanation of zero-length array example
gcc/ChangeLog: * doc/extend.texi (Zero Length): Describe example.
-rw-r--r--gcc/doc/extend.texi3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index ac47680..e426a2e 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -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