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 CF85945F52; Fri, 27 Dec 2024 02:33:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 85E58402F2; Fri, 27 Dec 2024 02:33:30 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 21ACD40275 for ; Fri, 27 Dec 2024 02:33:27 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 40EAC203EC2A; Thu, 26 Dec 2024 17:33:26 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 40EAC203EC2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1735263206; bh=/riE6MuB6InAzAwe272Fm3bAR8jaTLDDMdteWode3vs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E/b5JV2d6Y2UCPysWiu8xaUfmjTApSrvPZEqno3sLr2r0x8t8AVqZeubUextIhprD cCAMBijnW3U+jkyy846Ix3YQbrXu7Xe1xJiqnQcHeW5KTMlgiSNLY4kuf6GqNlFM0z ayGejzlpYklz0pjn7Md6j3E93ZiGqXaBsi+27IJw= From: Andre Muezerie To: Bruce Richardson , Konstantin Ananyev , Jingjing Wu , Praveen Shetty Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH 2/3] drivers/common: add diagnostics macros to make code portable Date: Thu, 26 Dec 2024 17:33:15 -0800 Message-Id: <1735263196-2809-3-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1735263196-2809-1-git-send-email-andremue@linux.microsoft.com> References: <1735263196-2809-1-git-send-email-andremue@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 It was a common pattern to have "GCC diagnostic ignored" pragmas sprinkled over the code and only activate these pragmas for certain compilers (gcc and clang). Clang supports GCC’s pragma for compatibility with existing source code, so #pragma GCC diagnostic and #pragma clang diagnostic are synonyms for Clang (https://clang.llvm.org/docs/UsersManual.html). Now that effort is being made to make the code compatible with MSVC these expressions would become more complex. It makes sense to hide this complexity behind macros. This makes maintenance easier as these macros are defined in a single place. As a plus the code becomes more readable as well. Signed-off-by: Andre Muezerie --- drivers/common/idpf/idpf_common_rxtx_avx512.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/common/idpf/idpf_common_rxtx_avx512.c b/drivers/common/idpf/idpf_common_rxtx_avx512.c index b8450b03ae..d298a5ca36 100644 --- a/drivers/common/idpf/idpf_common_rxtx_avx512.c +++ b/drivers/common/idpf/idpf_common_rxtx_avx512.c @@ -6,9 +6,7 @@ #include "idpf_common_device.h" #include "idpf_common_rxtx.h" -#ifndef __INTEL_COMPILER -#pragma GCC diagnostic ignored "-Wcast-qual" -#endif +__rte_diagnostic_ignored_wcast_qual #define IDPF_DESCS_PER_LOOP_AVX 8 #define PKTLEN_SHIFT 10 -- 2.47.0.vfs.0.3