Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp4440383ybn; Sat, 28 Sep 2019 00:17:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6XQa5JiRw6wZ6zhNCUgOx6dJf94syiVZfss2JMiDr+rUiLyfMzn4j7H7VeRW4TonwM5oT X-Received: by 2002:a50:b6a8:: with SMTP id d37mr8715103ede.63.1569655049024; Sat, 28 Sep 2019 00:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569655049; cv=none; d=google.com; s=arc-20160816; b=ZLWJoEIJbs1EP+B9j6NT6myQaiktUlIYM8LjFBx5SaNAtDSQMx7ARc2gQ/ZVhuoYNq 7/n7GUtCl0tHeeuEO9lQu+ttNBPWFiyF0RPyJ3R9RTNIN1rwcT66D7oM0p3HVsKdYyhQ nQGfw2ajkGFw3zDFmi/RURv+wu+mJducK1xinGxvKGXUpkK1JXRYe0cOrYQ+EG4frdmL J872mhNEV1wnEJoucdxp+gt7NT1rbMcSywfoxHSO8C02TVBDoqMcmVeGvWHktrPkWXcp XcnHmeew80lTMOuFeRmtb6rpk4tIg+sBFOOKaZ39ad9v/Vp/jzKdvSkEQl8hZupCa+8Q 3dCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=KZq9DtsO6QhN5/9GGXMzcf1p2KXzuNObf3I8NZ/BeXY=; b=qYLUed9BEaDW6l9sIbROOyum/macT4Ml8sow4em5N+t/86XPxAO3+mvH4aouq9uPij ovyEaVI7T8OLxAgHiOul+d5x40S6wJTlungzFMW9cfAr0UyOEmLwnYS78MgWkFqint5b 9VxBIm2FwYGis/8PYVuTX3tqXZNUYtZiVEHAq84YniFtK4lkONZLMrGsB4435hJU2/Qy WbhEX9WBk3eCBuNychuc3D1sZ+1X5h8hyLidFYJcnu2hYC9aeqrX05ihBY1y8YwCr7ql MrjPxYdXDiIUdm3Z5SsHkA4aLEGrQA0u1P0PHB2F1JNsj9lD+YZqaBbFw6m/WWuc6MsF uUMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e46si3060322eda.401.2019.09.28.00.16.52; Sat, 28 Sep 2019 00:17:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726245AbfI1HQr (ORCPT + 99 others); Sat, 28 Sep 2019 03:16:47 -0400 Received: from ms.lwn.net ([45.79.88.28]:35680 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfI1HQq (ORCPT ); Sat, 28 Sep 2019 03:16:46 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id 30D802B4; Sat, 28 Sep 2019 07:16:43 +0000 (UTC) Date: Sat, 28 Sep 2019 01:16:39 -0600 From: Jonathan Corbet To: Stephen Kitt Cc: linux-doc@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-can@vger.kernel.org, linux-afs@lists.infradead.org, kvm@vger.kernel.org, "Gustavo A . R . Silva" Subject: Re: [PATCH] docs: use flexible array members, not zero-length Message-ID: <20190928011639.7c983e77@lwn.net> In-Reply-To: <20190927142927.27968-1-steve@sk2.org> References: <20190927142927.27968-1-steve@sk2.org> Organization: LWN.net X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 Sep 2019 16:29:27 +0200 Stephen Kitt wrote: > Update the docs throughout to remove zero-length arrays, replacing > them with C99 flexible array members. GCC will then ensure that the > arrays are always the last element in the struct. I appreciate the thought but... > diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst > index 4d565d202ce3..24ce50fc1fc1 100644 > --- a/Documentation/bpf/btf.rst > +++ b/Documentation/bpf/btf.rst > @@ -670,7 +670,7 @@ func_info for each specific ELF section.:: > __u32 sec_name_off; /* offset to section name */ > __u32 num_info; > /* Followed by num_info * record_size number of bytes */ > - __u8 data[0]; > + __u8 data[]; > }; I only checked this one, but found what I had expected: the actual definition of this structure (found in tools/lib/bpf/libbpf_internal.h) says "data[0]". We can't really make the documentation read the way we *wish* the source would be, we need to document reality. I'm pretty sure that most of the other examples will be the same. If you really want to fix these, the right solution is to fix the offending structures — one patch per structure — in the source, then update the documentation to match the new reality. Thanks, jon