From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B6BE345F5F;
	Sat, 28 Dec 2024 04:18:48 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 02B43402D4;
	Sat, 28 Dec 2024 04:18:44 +0100 (CET)
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
 by mails.dpdk.org (Postfix) with ESMTP id A43AA4021F
 for <dev@dpdk.org>; Sat, 28 Dec 2024 04:18:41 +0100 (CET)
Received: by linux.microsoft.com (Postfix, from userid 1213)
 id AE14F206ADC7; Fri, 27 Dec 2024 19:18:40 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AE14F206ADC7
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
 s=default; t=1735355920;
 bh=VF37J+c7Etaxx0mVWH4zS0AGrKFJBx8y3xt9Rb0pFeo=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=I05EJf2ZsU46SPwOElozYMBIjomFGu0aQwBg37x4fDFP0Sh9E7Qqmm4XuNZmzR5eh
 VBZHeKd1NOBQT6vYVWqY8DBsiKucLBs3oQPtFsll3R3cxGjwjrNBxflYYLZzxM3ezb
 jO3B5gYQmw3UudiyBmW9Q3Pwgr1PuqDbSuxgicR0=
From: Andre Muezerie <andremue@linux.microsoft.com>
To: andremue@linux.microsoft.com
Cc: dev@dpdk.org,
	stephen@networkplumber.org
Subject: [PATCH v3 0/3] add diagnostics macros to make code portable
Date: Fri, 27 Dec 2024 19:18:27 -0800
Message-Id: <1735355910-1175-1-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>
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=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.

v3:
 * Added __rte_diagnostic_ignored_wcast_qual to a few more places where
   it was needed.

v2:
 * Removed __rte_diagnostic_ignored_wstrict_aliasing (introduced
   in v1).
 * Removed the pragmas from many files where they were not needed.
 * In the files where the pragmas were indeed needed, reduced the
   scope during which they are active, reducing the chance that
   unforeseen issues are hidden due to warning suppression.

Andre Muezerie (3):
  lib/eal: add diagnostics macros to make code portable
  drivers/common: add diagnostics macros to make code portable
  drivers/net: add diagnostics macros to make code portable

 drivers/common/idpf/idpf_common_rxtx_avx512.c | 46 +++++++++++++++++--
 drivers/net/axgbe/axgbe_rxtx.h                |  9 ----
 drivers/net/cpfl/cpfl_rxtx_vec_common.h       |  4 --
 drivers/net/dpaa2/dpaa2_rxtx.c                | 16 ++-----
 drivers/net/fm10k/fm10k_rxtx_vec.c            | 19 ++++++--
 drivers/net/hns3/hns3_rxtx_vec_neon.h         |  5 +-
 .../net/i40e/i40e_recycle_mbufs_vec_common.c  |  2 -
 drivers/net/i40e/i40e_rxtx_common_avx.h       | 16 +++++--
 drivers/net/i40e/i40e_rxtx_vec_altivec.c      | 11 ++++-
 drivers/net/i40e/i40e_rxtx_vec_avx2.c         | 16 +++++--
 drivers/net/i40e/i40e_rxtx_vec_avx512.c       | 16 +++++--
 drivers/net/i40e/i40e_rxtx_vec_common.h       |  4 --
 drivers/net/i40e/i40e_rxtx_vec_neon.c         |  9 ++--
 drivers/net/i40e/i40e_rxtx_vec_sse.c          | 22 +++++++--
 drivers/net/iavf/iavf_rxtx_vec_avx2.c         | 21 +++++++--
 drivers/net/iavf/iavf_rxtx_vec_avx512.c       | 27 +++++++++--
 drivers/net/iavf/iavf_rxtx_vec_common.h       | 10 ++--
 drivers/net/iavf/iavf_rxtx_vec_sse.c          | 30 ++++++++++--
 drivers/net/ice/ice_rxtx_common_avx.h         | 10 ++--
 drivers/net/ice/ice_rxtx_vec_avx2.c           | 16 +++++--
 drivers/net/ice/ice_rxtx_vec_avx512.c         | 16 +++++--
 drivers/net/ice/ice_rxtx_vec_common.h         |  4 --
 drivers/net/ice/ice_rxtx_vec_sse.c            | 22 +++++++--
 drivers/net/idpf/idpf_rxtx_vec_common.h       |  4 --
 .../ixgbe/ixgbe_recycle_mbufs_vec_common.c    |  2 -
 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c       |  2 -
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c        | 19 ++++++--
 drivers/net/mlx5/mlx5_flow.c                  |  6 +--
 drivers/net/mlx5/mlx5_rxtx_vec_altivec.h      |  5 --
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h         |  2 -
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h          | 26 ++++++++---
 drivers/net/tap/tap_flow.c                    |  6 +--
 drivers/net/virtio/virtio_rxtx_simple.c       |  4 --
 lib/eal/include/rte_common.h                  | 23 ++++++++++
 34 files changed, 312 insertions(+), 138 deletions(-)

--
2.47.0.vfs.0.3