Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp50570pxb; Tue, 31 Aug 2021 14:54:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgCj8LCy5rcZH4u18eNpuaZ9WxVyZJNAhJHLf6Gj0JJzmMhLrQMqolrLJEooR7AxE1PUdX X-Received: by 2002:a17:906:c182:: with SMTP id g2mr33232971ejz.507.1630446846789; Tue, 31 Aug 2021 14:54:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1630446846; cv=pass; d=google.com; s=arc-20160816; b=gQl3D6WMK7+nv0+dOOFJurFF9rj78Clf3PZcYeM6C0xXVjdYQwv6iALc/8HozSlXMM 4OEpKkDI6WlMJsk29hP+Pb7b060AQ9MVD22x6ZRvssnDjegxFkFCFtAJ7GH9cduUtNgj d0EUhPPJGKWcERDXbCqty18JbqKcAM/Mz4JE/8PigBW4aLWbS7b5KOZTTVcYfGhqelzy /S39eHSHlws25s6UTK8/5PbVgSq4tHjNZxkCIA+h3WpCjw/RQg7PSgUj/Ic21tUVS3mg u9uVQEkzI/zHBZ5SZthsiqhAuAajL/XO+3h2FXKSlSH2V32DeGwfWCl102gTpj6tvJmU bOMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-language :content-transfer-encoding:in-reply-to:user-agent:date:message-id :organization:from:references:cc:to:subject; bh=1zLejdb/EDjRXWXI+zMQsxGOYaBoV6kz9eZxnNSYvDk=; b=su2smqK8pBw+hRwcyw6Kxq9IPl6DfYYo7uu7I+VSCprC68PjMiTMtD6TAzjAl+Hu32 J5it0/U2j18GuVaZ93e0bg3WJ4SqmZITTtV+OA1aqTebTC5kA4PlUDKyH0jG8r5fMWlY 0TXpn6jr+hxzvcXlDW5UGSDt+7Qsleubd47XLURL/GPSunn3iJ89OhDOfcIkMDtLaOwO siUcrrrQrm5ZXyZ94vnVw9OSHqsgE/bgaAQ78nBOSrZ+IhT51ZpslqgHgH34VvxlN7b/ G+hnVq47MvzDZpaWdsC5k5fJs7Ehp8bYE3OldKLNXvDjzUSVoUPYUNkTFqYxqmrxYOCz +gNw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pabigot.com dkim=pass dkdomain=pabigot.com dmarc=pass fromdomain=pabigot.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 i14si23561465eje.121.2021.08.31.14.53.42; Tue, 31 Aug 2021 14:54:06 -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; arc=pass (i=1 spf=pass spfdomain=pabigot.com dkim=pass dkdomain=pabigot.com dmarc=pass fromdomain=pabigot.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 S241328AbhHaVbQ (ORCPT + 99 others); Tue, 31 Aug 2021 17:31:16 -0400 Received: from mail-bn8nam12on2134.outbound.protection.outlook.com ([40.107.237.134]:33088 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240401AbhHaVbO (ORCPT ); Tue, 31 Aug 2021 17:31:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2/Mv6XRf2PFgEbW0F6aVIatEsag5AzEGbTajVvcoPIHOWRefyqSMXNg61lLlOFjOfTn8OjddXprA9XdhpspGd8dONKMutHIbneKiPxcGYTrdCFxG536+uMayPnWHQVBdEb7wItlHJZk12dIsO4kxiLZHmAxiC+4VETdcinePEmy1zR+8qtgvkDA5Qi6srvoXoZ995f5+sp5vm3AOLyAxu1JO4arYP+PpYoO1KBGgLbS/S6IftvNJY8OvF1qOcxAjXqNQhzp4099b5R5CnqqQMK+rg9RXCvekDvtBQAb+oPBK35EE1wxBCgCnCRZNyouFiVuntzhznZrjbuL3ZGsVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1zLejdb/EDjRXWXI+zMQsxGOYaBoV6kz9eZxnNSYvDk=; b=OAZTNOcG+fAS/DAoybefH2j7jV3dnHtNEvHFUzcAEkq1FVlODkKh/hu7ohN8t2/5u7FmdAmAnQs4+wK5VNrF2xrJ/IJmTOAIRUjhjudgXIyHaEz0y7xwfFUUX1VQCmRPFrqjOLQ4aSBHOnr2+gUlc+zrDLRo0f95V5vroOvPUo1Xc63AZ4Dj/73r21M6U8jaDWmsSganoN29g2iPpUIhs5zp6JzIAWMVRQElueGkaVqXD9qgOJ4KuQURCJNVHPtWTX/6sl1lPhl517hwudUHdEO7AQOpDAAnkNcnxIT/tv9hhlpmgiiL4DYSu3Ph0SCJj/1xE9henTGRWf0YoqhcBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=pabigot.com; dmarc=pass action=none header.from=pabigot.com; dkim=pass header.d=pabigot.com; arc=none Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=pabigot.com; Received: from CY4PR22MB0581.namprd22.prod.outlook.com (2603:10b6:903:e2::10) by CY4PR2201MB1367.namprd22.prod.outlook.com (2603:10b6:910:62::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17; Tue, 31 Aug 2021 21:30:16 +0000 Received: from CY4PR22MB0581.namprd22.prod.outlook.com ([fe80::d9f0:a6ad:c10c:18ad]) by CY4PR22MB0581.namprd22.prod.outlook.com ([fe80::d9f0:a6ad:c10c:18ad%3]) with mapi id 15.20.4457.024; Tue, 31 Aug 2021 21:30:16 +0000 Subject: Re: [BlueZ PATCH] lib: fix variable-length array declarations in hci structures To: Marcel Holtmann Cc: linux-bluetooth@vger.kernel.org References: <20210831163545.3646157-1-pab@pabigot.com> <3CBFA8E8-ABA1-495F-BFD4-A4E3CBC1E21B@holtmann.org> From: "Peter A. Bigot" Organization: Peter Bigot Consulting, LLC Message-ID: Date: Tue, 31 Aug 2021 14:30:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: <3CBFA8E8-ABA1-495F-BFD4-A4E3CBC1E21B@holtmann.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-ClientProxiedBy: SJ0PR13CA0089.namprd13.prod.outlook.com (2603:10b6:a03:2c4::34) To CY4PR22MB0581.namprd22.prod.outlook.com (2603:10b6:903:e2::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.65.21] (67.1.116.23) by SJ0PR13CA0089.namprd13.prod.outlook.com (2603:10b6:a03:2c4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.6 via Frontend Transport; Tue, 31 Aug 2021 21:30:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a15ce9ba-87cb-4683-9227-08d96cc685f6 X-MS-TrafficTypeDiagnostic: CY4PR2201MB1367: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uvHgz++tiHrMKdBN/BWIh0sqhaqMwVaPVaSNO5VsoxOUsq7SXZGeaIHJd6bk/WwDtTH7b6M7EdEg9oI4tzLjzcNRn4kaP2ZPWeznSdbKyjxpNP9w79D7mQvKxcq4H5m4N7xBbXpZm1AIC4fRXGhcjwNeYKbAGVesYoO08QJg51tr0AmdNqZtB6gyPEJ/iwAPwX7b4BYRABkw5Nc0qyfs3PGiiCGtgvMK4Ti6yUrCtmNVzEyR2ap4uLil34Z/0lmbo7thscU4EiM+8zPASzy6o2Pv9njH97r5Gu1G8gRM6YkviXrVKIb8sTaNgvO+9hUpqOWCx3EIdZUsz1BA/13hCI+JA5z/Ah7UQ4YHChmicdE39xuMa1B48uR+tCdfiAineVGYMBhLGqM80GhMzgbdL1UnGuiK9uiMJHsP5gF8VVhlYtj51zKdnL2cA/dZkyATHzOZI7/bAer9G8GweJCF46u0iHIuS+X3B2357yaW8yY+7daWHBpwW8gMiyeHFjpBa/OHTPMalYFuMJpXRuD5HdTN9X4z7/GTjEsu2tSGKY2RKyeUeBulryKZwG4I5JbEkDpAIDhpRhzvWlBXp5quzY+C82xRcPZPNOs3gvFqe86QKlte75GFQyXaAaCMyIFBSQvW0ZxnAIW1l0e5NZZ6kYqWmRnQlUT75uSVIJe7xOKqj/cLFVVtFyRNT/WuPE/ocNbqbUNYb5aehZDU4pQGt09lwB9rGvDicNeerCFnX473qU9EqEl7GLwNXGjnfcBu1IbapZDFvA+NVtRmoL+uBg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR22MB0581.namprd22.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(346002)(39830400003)(366004)(136003)(86362001)(36756003)(16576012)(31696002)(2616005)(2906002)(26005)(8936002)(956004)(316002)(53546011)(8676002)(83380400001)(6486002)(5660300002)(186003)(36916002)(52116002)(6916009)(38350700002)(38100700002)(66476007)(478600001)(66556008)(66946007)(31686004)(6666004)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 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?Q?XgbZRUpQtR5QGqVnnOXClFEuRTRnYAKDwj0tzkj?= X-OriginatorOrg: pabigot.com X-MS-Exchange-CrossTenant-Network-Message-Id: a15ce9ba-87cb-4683-9227-08d96cc685f6 X-MS-Exchange-CrossTenant-AuthSource: CY4PR22MB0581.namprd22.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2021 21:30:16.0677 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 93ff3220-27ea-4632-aa49-46b51ff93a85 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1Y7XCBBxWmQVIGEAbvbOLzB0FUuZ7ruUUvNqZPVnUSAshDR5TuC8eDym1zHrIaKL X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR2201MB1367 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On 8/31/21 2:23 PM, Marcel Holtmann wrote: > 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. The size of the structure remains the same; there should be no API changes.  I've done this sort of change multiple times over the years and nobody's reported any problems. Peter