From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 6F7833858D20 for ; Thu, 27 Apr 2023 07:26:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F7833858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2a8db10a5d4so80577771fa.1 for ; Thu, 27 Apr 2023 00:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682580373; x=1685172373; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gWU71wJrqNvh+IvxybjhuJXzm0xxV+wxLzly9KDvTXY=; b=EJqVdEizb0HWkwgh73naL21QYY6FutkkbS+yez9HLwsxlw34DRchVVfYaILHZDC53x j8XT5jme/LdOLJthFJJBjetuYSktP9pAkdNM7hwJNqS2ZT3lVYNkzIN4QTfVk3VR9ReA fzfYPhjt7bUmt6Uet3vU++nXm1IlMh8Rzn/HMiEzftiGySRnkqgNwZZ4MUphkoZmxPt7 kOSFnEy7OzGsNxdM0MVU2Ir8V/78igH3lYhesb606rF4PFUPwiKoL5BlIV3y3IcvUUrD sUqhFBQoWUgA9xOfsmgQQktH2V7WUXijvLhgd7zrdwJaCzrk+4i2HUpIcuF58A6xW5hv SpMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682580373; x=1685172373; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gWU71wJrqNvh+IvxybjhuJXzm0xxV+wxLzly9KDvTXY=; b=ZLhQ+LMEli819wvqyaUUwayJgez4FvBhjPt2zoV+kyW3XSlO5WTKLQGtIEF3+jIiY/ xw3QbbZ0Np6RMVzQJbuQUuDBGgHiN+oo0MbPgObZKQCHe1WUOVtxthWMt5uMIEfiZHFy Yfn7gmmoEtrEI7e+MLbE4aZEebm/2w8o1SnYcuAJVsl0/AjXtgRAVbW5uqVMp3j0/Hzp gvJD+hhjZ0tbLdLfcexfMyQ+vUVC8j9MqT/bZGU8zaVLblcjnwpBU+11p6A8ULW3mQ+R 5xy2iuUWdJenr9BHCDoxB6ga8Kb7BbZUR7eGHu9WUz9GDpifPSo8+IFwkrYu4E6MRKqI 0IBw== X-Gm-Message-State: AC+VfDw/76RR4g4VZOvfL0JQls/zDHxl1mWHws/4Mc0nFLCyeT+IUDbS ggk1Q+5WEVL0FTOaxw8JgT+SA01aJVqeaNWRxXg= X-Google-Smtp-Source: ACHHUZ4kD+G9mFmnq/BkJQ7j3YQ5YH2jnH7rsAw1vPvaszWkVn0gIQ+k473wEpgUl6A+oYHsRgMzvH6kB+Wiu3hq/6c= X-Received: by 2002:a05:651c:c6:b0:2a8:b129:f735 with SMTP id 6-20020a05651c00c600b002a8b129f735mr320936ljr.28.1682580372570; Thu, 27 Apr 2023 00:26:12 -0700 (PDT) MIME-Version: 1.0 References: <20230426161539.1571701-1-jwakely@redhat.com> In-Reply-To: <20230426161539.1571701-1-jwakely@redhat.com> From: Richard Biener Date: Thu, 27 Apr 2023 09:24:43 +0200 Message-ID: Subject: Re: [PATCH] doc: Add explanation of zero-length array example To: Jonathan Wakely Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Apr 26, 2023 at 6:16=E2=80=AFPM Jonathan Wakely via Gcc-patches wrote: > > As suggested here: > https://gcc.gnu.org/pipermail/gcc/2023-April/241190.html > > OK for trunk? OK > -- >8 -- > > gcc/ChangeLog: > > * doc/extend.texi (Zero Length): Describe example. > --- > gcc/doc/extend.texi | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi > index 84b44cb9916..06134a50ad2 100644 > --- a/gcc/doc/extend.texi > +++ b/gcc/doc/extend.texi > @@ -1705,6 +1705,9 @@ struct line *thisline =3D (struct line *) > thisline->length =3D this_length; > @end smallexample > > +In this example, @code{thisline->contents} is an array of @code{char} th= at > +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 tai= l > padding. The offset of a zero-length array member from the beginning > -- > 2.40.0 >