+2024-01-10 Bruno Haible <bruno@clisp.org>
+
+ jit/cache tests: Avoid compiler warnings on OpenBSD.
+ * tests/jit/test-cache.c (main): New variables size_of_return1,
+ size_of_return2.
+
2024-01-09 Bruno Haible <bruno@clisp.org>
jit/cache: Fix for ia64 CPUs.
{
void const *code_of_return1;
void const *code_of_return2;
+ size_t size_of_return1;
+ size_t size_of_return2;
#if defined __OpenBSD__ || defined _RET_PROTECTOR
/* OpenBSD maps code with PROT_EXEC (as opposed to PROT_READ | PROT_EXEC).
We need to use predetermined code for 'return1' and 'return2'. */
we need to use predetermined code for 'return1' and 'return2'. */
code_of_return1 = return1_code;
code_of_return2 = return2_code;
+ size_of_return1 = sizeof (return1_code);
+ size_of_return2 = sizeof (return2_code);
#else
code_of_return1 = CODE (return1);
code_of_return2 = CODE (return2);
-#endif
/* We assume that the code is not longer than 64 bytes. */
- size_t code_size_bound = 64;
+ size_of_return1 = 64;
+ size_of_return2 = 64;
+#endif
int const pagesize = getpagesize ();
int const mapping_size = 1 * pagesize;
int (*f) (void) = COPY_FUNCPTR (return1);
CODE (f) = start;
- memcpy (start_rw, code_of_return1, code_size_bound);
+ memcpy (start_rw, code_of_return1, size_of_return1);
clear_cache (start, end);
ASSERT (f () == 1);
- memcpy (start_rw, code_of_return2, code_size_bound);
+ memcpy (start_rw, code_of_return2, size_of_return2);
clear_cache (start, end);
ASSERT (f () == 2);