[PATCH 1/2] mempool: replace GCC pragma with cast
Stephen Hemminger
stephen at networkplumber.org
Mon Apr 1 19:01:52 CEST 2024
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 at networkplumber.org>
---
lib/mempool/rte_mempool.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 12390a2c81..734e8a2feb 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)
--
2.43.0
More information about the dev
mailing list