From 04c3fbf331062d7a9f179c70675cf7d47e19be91 Mon Sep 17 00:00:00 2001 From: Dominik Loidolt <dominik.loidolt@univie.ac.at> Date: Wed, 13 Mar 2024 14:29:43 +0100 Subject: [PATCH] Fix sparc-elf-gcc (BCC 4.4.2 release 1.0.50) does not support printf for long long types --- lib/common/leon_inttypes.h | 3 +++ test/cmp_decmp/test_cmp_decmp.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/common/leon_inttypes.h b/lib/common/leon_inttypes.h index 694af3e..7374e27 100644 --- a/lib/common/leon_inttypes.h +++ b/lib/common/leon_inttypes.h @@ -49,6 +49,8 @@ # define PRIX32 "lX" #endif /*PRIX32*/ +#if 0 +/* sparc-elf-gcc (BCC 4.4.2 release 1.0.50) does not support printf for long long types */ #ifndef PRId64 # define PRId64 "lld" #endif /*PRId64*/ @@ -72,6 +74,7 @@ #ifndef PRIX64 # define PRIX64 "llX" #endif /*PRIX64*/ +#endif #endif /* __sparc__ */ diff --git a/test/cmp_decmp/test_cmp_decmp.c b/test/cmp_decmp/test_cmp_decmp.c index 0cfd4c4..d4959ca 100644 --- a/test/cmp_decmp/test_cmp_decmp.c +++ b/test/cmp_decmp/test_cmp_decmp.c @@ -22,6 +22,7 @@ #include <string.h> #include <stdlib.h> +#include <stdio.h> #include <unity.h> #include "../test_common/test_common.h" @@ -60,9 +61,11 @@ void setUp(void) #endif if (!n) { + uint32_t high = seed >> 32; + uint32_t low = seed & 0xFFFFFFFF; n = 1; cmp_rand_seed(seed); - printf("seed: %"PRIu64"\n", seed); + printf("seed: 0x%08"PRIx32"%08"PRIx32"\n", high, low); } } -- GitLab