From: David Christensen Date: Thu, 2 Sep 2021 22:15:14 +0000 (-0700) Subject: eal/ppc: ignore GCC 10 stringop-overflow warnings X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c13e6177394365d4db1595ea038bd9c3de04d32f;p=dpdk.git eal/ppc: ignore GCC 10 stringop-overflow warnings Suppress gcc warning "warning: writing 16 bytes into a region of size 0" for users of the POWER rte_memcpy() function. Existing rte_memcpy() code takes different code paths based on the actual size of the move so the warning is already addressed. See also commit b5b3ea803e47 ("eal/x86: ignore gcc 10 stringop-overflow warnings") Cc: stable@dpdk.org Signed-off-by: David Christensen --- diff --git a/lib/eal/ppc/include/rte_memcpy.h b/lib/eal/ppc/include/rte_memcpy.h index c2a1f356d5..6f388c0234 100644 --- a/lib/eal/ppc/include/rte_memcpy.h +++ b/lib/eal/ppc/include/rte_memcpy.h @@ -1,6 +1,6 @@ /* * SPDX-License-Identifier: BSD-3-Clause - * Copyright (C) IBM Corporation 2014. + * Copyright (C) IBM Corporation 2014,2021 */ #ifndef _RTE_MEMCPY_PPC_64_H_ @@ -18,11 +18,16 @@ extern "C" { #include "generic/rte_memcpy.h" -#if (GCC_VERSION >= 90000 && GCC_VERSION < 90400) +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 90000) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #endif +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100000) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + static inline void rte_mov16(uint8_t *dst, const uint8_t *src) { @@ -198,7 +203,11 @@ rte_memcpy_func(void *dst, const void *src, size_t n) return ret; } -#if (GCC_VERSION >= 90000 && GCC_VERSION < 90400) +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100000) +#pragma GCC diagnostic pop +#endif + +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 90000) #pragma GCC diagnostic pop #endif