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 57BA3A0544; Fri, 2 Sep 2022 09:43:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32D6440693; Fri, 2 Sep 2022 09:43:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 00F4140684; Fri, 2 Sep 2022 09:43:48 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 281KFBol004277; Fri, 2 Sep 2022 00:43:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=HTzhrYuhAopRmWZztIYIC2XwzX1WQFbbwEYjKph/LGA=; b=IM5MyGkyWjVx/t3BzKFh5pFY9Z9EkXMvlRSCXeIx3Ok/1kRRiHIfzhNrDKoFtItrlsKc DbTDPQdQtclA0wZ2qmw7n/stsFywhLkoTG97dRGw3rWO9DktJDQM1FaJRo8znVveutUe OESwHeh6EaOtSvOrBapM1sFlltqOehn/LzKshPYMgqYSLXmD8zAkN3c7X/WTQBPpSInB 7+VG5N6sGGJGxvv0mQzMPvYN96/BDUc/zP7Usty8gd1X4rQ/U6RIE1yeasOZye9se5B7 yxzl2oem2lU/nz9S7S8vFYtAaZUlMJUvVvQWN6iaKJsrxEuNO+YcpHRsVRCHCO1hQ7u1 Yg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3jb3kuj1pa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 02 Sep 2022 00:43:45 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 2 Sep 2022 00:43:44 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 2 Sep 2022 00:43:44 -0700 Received: from localhost.localdomain (unknown [10.28.36.157]) by maili.marvell.com (Postfix) with ESMTP id C2C6D5B6949; Fri, 2 Sep 2022 00:43:41 -0700 (PDT) From: Amit Prakash Shukla To: Ruifeng Wang CC: , , , , , Amit Prakash Shukla Subject: [PATCH v2] examples: compilation fix for GCC-12 Date: Fri, 2 Sep 2022 13:13:37 +0530 Message-ID: <20220902074337.3129786-1-amitprakashs@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220901082343.3074804-1-amitprakashs@marvell.com> References: <20220901082343.3074804-1-amitprakashs@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: kRJF46KjR04H1eYvgFbdrpCKvlKZ7wHZ X-Proofpoint-GUID: kRJF46KjR04H1eYvgFbdrpCKvlKZ7wHZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-01_12,2022-08-31_03,2022-06-22_01 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 GCC-12 warns when a pointer of type union points to an array of same defined size, as union internally gets paded with pad bytes. ../examples/common/neon/port_group.h:42:21: error: array subscript 'union [0]' is partly outside array bounds of 'uint16_t[5]' {aka 'short unsigned int[5]'} [-Werror=array-bounds] 42 | pnum->u64 = gptbl[v].pnum; | ^~ ../examples/common/neon/port_group.h:21:23: note: object 'pn' of size [0, 10] 21 | port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1 | ~~~~~~~~~^~~~~~~~~~~~~~~ ../examples/common/neon/port_group.h:43:21: error: array subscript 'union [0]' is partly outside array bounds of 'uint16_t[5]' {aka 'short unsigned int[5]'} [-Werror=array-bounds] 43 | pnum->u16[FWDSTEP] = 1; | ^~ Fixes: bdfc3816fbfc ("examples: common packet group functionality") Cc: stable@dpdk.org Signed-off-by: Amit Prakash Shukla --- v2: - Changed to __rte_packed instead of direct attribute examples/common/neon/port_group.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/common/neon/port_group.h b/examples/common/neon/port_group.h index 82c6ed6d73..04e5699f70 100644 --- a/examples/common/neon/port_group.h +++ b/examples/common/neon/port_group.h @@ -24,7 +24,7 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1, union { uint16_t u16[FWDSTEP + 1]; uint64_t u64; - } *pnum = (void *)pn; + } __rte_packed *pnum = (void *)pn; uint16x8_t mask = {1, 2, 4, 8, 0, 0, 0, 0}; int32_t v; -- 2.25.1