Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp49059pxb; Tue, 31 Aug 2021 14:51:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6SSirh4yUiZ0JfdKl7EqeziOcBi9JRJRc+lKjOkZibM12n86YFSjTVceUfE9A5iMvHy+P X-Received: by 2002:a17:907:6297:: with SMTP id nd23mr31779034ejc.62.1630446714032; Tue, 31 Aug 2021 14:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630446714; cv=none; d=google.com; s=arc-20160816; b=U/iT9/Wty1NqiX3KtmVgyewKizpIgdrWsZZSIZWTTPtvaHG6JHDkPB4xFYlnM6ejin /uxo1cEkcrQlwqm4R7iKBJ3GDxLXTw2kNiIH0/tgY+1nAJz2j5UO1jlYylefleoBkOzy 1nexXjA6VGV8diVktWKUv2J0Y2hTqES8f6/QcJTp4D/muKHmF/qaz9dSeVt9rtRZmkcB tadWgPIQ/pKzwXafdyiK5DKcDax0Q5Zj5hT5ngqV5HNWkG6BHKL7v3g9Qg7YfAuCApYt FnRNsJZrlLQ8xWvKF4WaL0EzKCFkZQdOLAiUDGMf0xfLkoLHVQVFk3+vB8gF+mEvNPSv K5Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=nxLYllIKSfQvy8U2DoSTs1t1H5WTMIofTcvzS5WY5VQ=; b=FV7uK8I6LdaGdh7C5WFdYtkv2zVu+woT+f2U/SSA0aebq3fC2w8v3rXq+T7KMQ8/cH 9XfAvjPWZ81kN7iU4gJ7oBwg1axAyPO6OFeSTSzXXLjr4lEawzv0zFTf9v0bJ+UFu2/D daOQ4poOS9WbceD5w27g6OWkNaQ5eyNDVAuXFT/rpWNKekRLM0Z9sfW8EAbr3jreSUa4 cEKSR82BW0clAM6LcqFdUIZFk0e9hVg6VxoiiZ64qsqFU88cxPnW6TOwiwIdPF305kNu Qml4I9aAFDhGKrFWXO9RwOfcqR7x2TJfNIRwMCF4ZjrNwFG0c68wUGxtBd3GVo9Bx/Bd U6zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do15si2836921ejc.513.2021.08.31.14.51.17; Tue, 31 Aug 2021 14:51:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240063AbhHaVYJ convert rfc822-to-8bit (ORCPT + 99 others); Tue, 31 Aug 2021 17:24:09 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:41876 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240571AbhHaVYG (ORCPT ); Tue, 31 Aug 2021 17:24:06 -0400 Received: from smtpclient.apple (p5b3d2185.dip0.t-ipconnect.de [91.61.33.133]) by mail.holtmann.org (Postfix) with ESMTPSA id 5EE36CECE5; Tue, 31 Aug 2021 23:23:07 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [BlueZ PATCH] lib: fix variable-length array declarations in hci structures From: Marcel Holtmann In-Reply-To: <20210831163545.3646157-1-pab@pabigot.com> Date: Tue, 31 Aug 2021 23:23:06 +0200 Cc: linux-bluetooth@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <3CBFA8E8-ABA1-495F-BFD4-A4E3CBC1E21B@holtmann.org> References: <20210831163545.3646157-1-pab@pabigot.com> To: "Peter A. Bigot" X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Peter, > Use of zero as the size for arrays as the last element of a structure > is a GNU C extension, which as of GCC 10 produces diagnostics when > values in the extended array are referenced. Switch to the C99 > standard idiom for flexible array members, already in use in a few > other headers. > > Signed-off-by: Peter A. Bigot > --- > > No changes from previous submission except the BlueZ subject prefix > that I hope will get this into bluez. > > lib/hci.h | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/lib/hci.h b/lib/hci.h > index 3382b87bf..a61568bce 100644 > --- a/lib/hci.h > +++ b/lib/hci.h > @@ -729,7 +729,7 @@ typedef struct { > typedef struct { > uint8_t flt_type; > uint8_t cond_type; > - uint8_t condition[0]; > + uint8_t condition[]; > } __attribute__ ((packed)) set_event_flt_cp; > #define SET_EVENT_FLT_CP_SIZE 2 does this break any API assumptions? Since as long as libbluetooth exists these headers are API. Regards Marcel