]> Savannah Git Hosting - gnulib.git/commitdiff
jit/cache tests: Avoid gcc -Wstrict-aliasing warning on Linux/powerpc64.
authorBruno Haible <bruno@clisp.org>
Wed, 10 Jan 2024 15:46:48 +0000 (16:46 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 18 Jan 2024 08:29:32 +0000 (09:29 +0100)
* tests/jit/test-cache.c (funcptr_to_structptr): Turn into an inline
function.

ChangeLog
tests/jit/test-cache.c

index 5e9a38a8094bb9ee3b826d7b4400d4a231e9ebd8..4c7b66520c40eccef5811ddbfb0b8a8f9d3e3572 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-01-10  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        jit/cache tests: Fix for arm CPUs with GCC target arm-linux-gnueabihf.
index cad6d2a214447e691b23c0d9019d1b614d182914..18416f8f51ed08cd9ce31b3136f79f26f74a6f6b 100644 (file)
@@ -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)