From: Bruno Haible Date: Wed, 10 Jan 2024 15:46:48 +0000 (+0100) Subject: jit/cache tests: Avoid gcc -Wstrict-aliasing warning on Linux/powerpc64. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=552145d3137ebbd6a52ac7b551e9e132343ef76d;p=gnulib.git jit/cache tests: Avoid gcc -Wstrict-aliasing warning on Linux/powerpc64. * tests/jit/test-cache.c (funcptr_to_structptr): Turn into an inline function. --- 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)