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-Tag: v1.0~528 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=715210d2a6b12b5597ea816eeb084fcfe77d080e;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 6187ed43a4..9a585178f9 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)