Skip to content

Commit eb5bd83

Browse files
authored
i#7577: Fix type warning in attach_state.c test (#7706)
The check_simd() function should use uint64_t instead of unsigned long long when calling the u128_to_2xu64() function. This avoids an 'incompatible pointer type' build warning. Issue: #7577
1 parent 7b9e768 commit eb5bd83

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

suite/tests/linux/attach_state.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* AArch64 only.
3737
*/
3838

39+
#include <inttypes.h>
3940
#include <stdlib.h>
4041
#include <stdio.h>
4142
#include <string.h>
@@ -106,12 +107,12 @@ check_simd(const __uint128_t *reg)
106107
{
107108
for (int i = 0; i < 32; i++) {
108109
if (reg[i] != simd_ref[i]) {
109-
unsigned long long got_hi, got_lo, exp_hi, exp_lo;
110+
uint64_t got_hi, got_lo, exp_hi, exp_lo;
110111
u128_to_2xu64(reg[i], &got_hi, &got_lo);
111112
u128_to_2xu64(simd_ref[i], &exp_hi, &exp_lo);
112-
printf(
113-
"SIMD mismatch v%-2d: expected 0x%016llx%016llx, got 0x%016llx%016llx\n",
114-
i, exp_hi, exp_lo, got_hi, got_lo);
113+
printf("SIMD mismatch v%-2d: expected 0x%016" PRIx64 "%016" PRIx64
114+
", got 0x%016" PRIx64 "%016" PRIx64 "\n",
115+
i, exp_hi, exp_lo, got_hi, got_lo);
115116
return -1;
116117
}
117118
}

0 commit comments

Comments
 (0)