From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F7BFA0559; Fri, 3 Jun 2022 11:18:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07CCB40694; Fri, 3 Jun 2022 11:18:34 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 9D63740691 for ; Fri, 3 Jun 2022 11:18:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654247911; x=1685783911; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=brS6dqICo0vWYJw/8L4VPmq2LB5VyiWvEhVoZK4cDwo=; b=V+fKqr2OXoOLzWyab4Ib+tJxLDRzFCXEvA/6YDJx3cBlVokpN4mZfV2M +VzVyEHEiB3prVtS2yszpSOAZwb6k9ICpTmabo0SD/Ee2x5MPHkvmutNO QzK9OquF3Hn5XfHUxiqXjwtp1zuslQJse/P+0C2eCt7SLE/Ebtwm8CRLI 1kKL89kX7su4dQ8xAa82cpVZpO9c4R3eKU1mPNEBd8g7qmCvCu4DpNAbc 3af17GeseH0tUx41YGu1RjwxP3cbOoCHm1KKMUyfKCpq5tjDiGMd12Tze l6w4N0y22VL9vEhdKzGbxftEItMX0HZT8PoxRZckX4+7smAJZYHksF7ch g==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="256072675" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="256072675" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 02:18:30 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="563710948" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.6.223]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 03 Jun 2022 02:18:29 -0700 Date: Fri, 3 Jun 2022 10:18:26 +0100 From: Bruce Richardson To: David Marchand Cc: dev , Morten =?iso-8859-1?Q?Br=F8rup?= , Stephen Hemminger Subject: Re: [PATCH v2 2/4] drivers: replace zero-length arrays with undimensioned ones Message-ID: References: <20220602150834.643745-1-bruce.richardson@intel.com> <20220602161324.1123926-1-bruce.richardson@intel.com> <20220602161324.1123926-3-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, Jun 03, 2022 at 09:19:35AM +0200, David Marchand wrote: > Hello Bruce, > > On Thu, Jun 2, 2022 at 6:14 PM Bruce Richardson > wrote: > > diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h > > index bc3e70a1d1..ed0781a560 100644 > > --- a/drivers/common/mlx5/mlx5_prm.h > > +++ b/drivers/common/mlx5/mlx5_prm.h > > @@ -560,7 +560,7 @@ struct mlx5_umr_wqe { > > struct mlx5_rdma_write_wqe { > > struct mlx5_wqe_cseg ctr; > > struct mlx5_wqe_rseg rseg; > > - struct mlx5_wqe_dseg dseg[0]; > > + struct mlx5_wqe_dseg dseg[]; > > } __rte_packed; > > > > #ifdef PEDANTIC > > @@ -3479,7 +3479,7 @@ struct mlx5_ifc_qpc_pas_list_bits { > > #endif > > struct mlx5_ifc_qpc_extension_and_pas_list_bits { > > struct mlx5_ifc_qpc_extension_bits qpc_data_extension; > > - u8 pas[0][0x40]; > > + u8[0x40] pas[]; > > Gcc and clang seem to agree they disagree with coccinelle. > clang suggests using u8 pas[][0x40]. > Changing this as suggested gives further errors in builds (now that I have the correct dependencies for the mlx5 driver installed on my system!) In file included from ../../drivers/net/mlx5/mlx5_tx_empw.c:6: ../../drivers/net/mlx5/mlx5_tx.h:187:30: error: invalid use of structure with flexible array member [-Werror=pedantic] 187 | struct mlx5_txq_data txq; /* Data path structure. */ | ^~~ cc1: all warnings being treated as errors Therefore, I'll just drop the cleanup of these structures from V3. /Bruce