diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2024-04-01 10:01:52 -0700 |
---|---|---|
committer | David Marchand <david.marchand@redhat.com> | 2024-06-14 16:22:34 +0200 |
commit | e0ddaa4c019542a2ba8c7b548556781c068c12be (patch) | |
tree | c9a77a974671198d69e1abfd79a930e1e18ddf7b | |
parent | 8521fc0c21fddf0b0ad4bd6e6d735db00db0b66c (diff) |
mempool: replace GCC pragma with cast
Building mempool with MSVC generates a warning
because of this pragma (same with clang when debug is enabled).
The issue the pragma was working around can be better solved
by using an additional cast.
Fixes: af75078fece3 ("first public release")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
-rw-r--r-- | lib/mempool/rte_mempool.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index 7a98441a87..ff67fe4181 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -1056,10 +1056,6 @@ rte_mempool_dump_cache(FILE *f, const struct rte_mempool *mp) return count; } -#ifndef __INTEL_COMPILER -#pragma GCC diagnostic ignored "-Wcast-qual" -#endif - /* check and update cookies or panic (internal) */ void rte_mempool_check_cookies(const struct rte_mempool *mp, void * const *obj_table_const, unsigned n, int free) @@ -1074,7 +1070,7 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp, /* Force to drop the "const" attribute. This is done only when * DEBUG is enabled */ - tmp = (void *) obj_table_const; + tmp = (void *)(uintptr_t)obj_table_const; obj_table = tmp; while (n--) { @@ -1183,10 +1179,6 @@ mempool_audit_cookies(struct rte_mempool *mp) #define mempool_audit_cookies(mp) do {} while(0) #endif -#ifndef __INTEL_COMPILER -#pragma GCC diagnostic error "-Wcast-qual" -#endif - /* check cookies before and after objects */ static void mempool_audit_cache(const struct rte_mempool *mp) |