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. v12: * Added macro RTE_IGNORE_CAST_QUAL and used it as a more compact and readable form to suppress warnings where a cast is used to remove a type qualifier. v11: * Added __rte_diagnostic_ignored_wcast_qual to a few more places where it was needed. v10: * Added __rte_diagnostic_ignored_wcast_qual to a few more places where it was needed. v9: * Added __rte_diagnostic_ignored_wcast_qual to a few more places where it was needed. v8: * Added __rte_diagnostic_ignored_wcast_qual to a few more places where it was needed. v7: * Added __rte_diagnostic_ignored_wcast_qual to a few more places where it was needed. v6: * Added __rte_diagnostic_ignored_wcast_qual to a few more places where it was needed. v5: * Added __rte_diagnostic_ignored_wcast_qual to a few more places where it was needed. v4: * Added __rte_diagnostic_ignored_wcast_qual to a few more places where it was needed. 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 | 77 ++++++++--------- 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 | 22 +++-- drivers/net/hns3/hns3_rxtx_vec_neon.h | 7 +- .../net/i40e/i40e_recycle_mbufs_vec_common.c | 2 - drivers/net/i40e/i40e_rxtx_common_avx.h | 24 +++--- drivers/net/i40e/i40e_rxtx_vec_altivec.c | 22 ++--- drivers/net/i40e/i40e_rxtx_vec_avx2.c | 40 +++++---- drivers/net/i40e/i40e_rxtx_vec_avx512.c | 30 ++++--- drivers/net/i40e/i40e_rxtx_vec_common.h | 4 - drivers/net/i40e/i40e_rxtx_vec_neon.c | 44 +++++----- drivers/net/i40e/i40e_rxtx_vec_sse.c | 34 ++++---- drivers/net/iavf/iavf_rxtx_vec_avx2.c | 84 ++++++++++--------- drivers/net/iavf/iavf_rxtx_vec_avx512.c | 78 ++++++++--------- drivers/net/iavf/iavf_rxtx_vec_common.h | 12 ++- drivers/net/iavf/iavf_rxtx_vec_neon.c | 27 +++--- drivers/net/iavf/iavf_rxtx_vec_sse.c | 56 +++++++------ drivers/net/ice/ice_rxtx_common_avx.h | 24 +++--- drivers/net/ice/ice_rxtx_vec_avx2.c | 82 +++++++++--------- drivers/net/ice/ice_rxtx_vec_avx512.c | 72 ++++++++-------- drivers/net/ice/ice_rxtx_vec_common.h | 4 - drivers/net/ice/ice_rxtx_vec_sse.c | 42 ++++------ 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 | 18 ++-- drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 22 +++-- drivers/net/mlx5/mlx5_flow.c | 5 +- drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 5 -- drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 18 ++-- drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 76 ++++++++++------- drivers/net/ngbe/ngbe_rxtx_vec_neon.c | 11 ++- drivers/net/tap/tap_flow.c | 6 +- drivers/net/txgbe/txgbe_rxtx_vec_neon.c | 8 +- drivers/net/virtio/virtio_rxtx_simple.c | 4 - lib/eal/include/rte_common.h | 26 ++++++ 37 files changed, 510 insertions(+), 511 deletions(-) -- 2.47.0.vfs.0.3