Skip to content

Commit 84c4e9e

Browse files
committed
src/metadata.c: fix format for __u64 in metadata.c
On ppc64le, __u64 is typedef'd as 'unsigned long' rather than 'unsigned long long', so using %llx triggers a -Wformat= warning. Update to use %" PRIx64 " to fix the warning. Fixes: #233 Signed-off-by: Yi Zhang <[email protected]> Assisted-by: Claude:claude-sonnet-4.6
1 parent 2824524 commit 84c4e9e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/metadata.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define _GNU_SOURCE
1010
#endif
1111
#include <stdio.h>
12+
#include <inttypes.h>
1213
#include <stdlib.h>
1314
#include <string.h>
1415
#include <fcntl.h>
@@ -245,7 +246,7 @@ static int check_metadata(void *p, int intervals, int ref)
245246
__u64 v = get_unaligned_be48(tuple->ref_tag);
246247

247248
if (v != ref) {
248-
fprintf(stderr, "reftag interval:%d expected:%x got:%llx\n",
249+
fprintf(stderr, "reftag interval:%d expected:%x got:%" PRIx64 "\n",
249250
i, ref, v);
250251
return -1;
251252
}

0 commit comments

Comments
 (0)