From 552145d3137ebbd6a52ac7b551e9e132343ef76d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 10 Jan 2024 16:46:48 +0100 Subject: [PATCH] jit/cache tests: Avoid gcc -Wstrict-aliasing warning on Linux/powerpc64. * tests/jit/test-cache.c (funcptr_to_structptr): Turn into an inline function. --- ChangeLog | 6 ++++++ tests/jit/test-cache.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5e9a38a809..4c7b66520c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-01-10 Bruno Haible + + jit/cache tests: Avoid gcc -Wstrict-aliasing warning on Linux/powerpc64. + * tests/jit/test-cache.c (funcptr_to_structptr): Turn into an inline + function. + 2024-01-10 Bruno Haible jit/cache tests: Fix for arm CPUs with GCC target arm-linux-gnueabihf. diff --git a/tests/jit/test-cache.c b/tests/jit/test-cache.c index cad6d2a214..18416f8f51 100644 --- a/tests/jit/test-cache.c +++ b/tests/jit/test-cache.c @@ -124,7 +124,11 @@ funcptr_to_structptr (void * volatile funcptr) } # else # define structptr_to_funcptr(p) ((void *) (p)) -# define funcptr_to_structptr(funcptr) ((struct func *) (funcptr)) +static inline struct func * +funcptr_to_structptr (void * volatile funcptr) +{ + return (struct func *) funcptr; +} # endif static inline struct func * xcopy_structptr (struct func *structptr) -- 2.39.5