From: Kent Gibson Date: Fri, 30 Jun 2023 09:08:57 +0000 (+0800) Subject: core: examples: fix warning for u64 formatting on 32bit X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e15c06c3064f8eaee41c8894e95581e500d6ac35;p=qemu-gpiodev%2Flibgpiod.git core: examples: fix warning for u64 formatting on 32bit The watch_line_info example prints the u64 timestamps using "%ld" which produces a warning for 32bit. Replace it with PRIu64. Signed-off-by: Kent Gibson Signed-off-by: Bartosz Golaszewski --- diff --git a/examples/watch_line_info.c b/examples/watch_line_info.c index 1879a62..9df3121 100644 --- a/examples/watch_line_info.c +++ b/examples/watch_line_info.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -63,7 +64,7 @@ int main(void) info = gpiod_info_event_get_line_info(event); timestamp_ns = gpiod_info_event_get_timestamp_ns(event); - printf("line %3d: %-9s %ld.%ld\n", + printf("line %3d: %-9s %" PRIu64 ".%" PRIu64 "\n", gpiod_line_info_get_offset(info), event_type(event), timestamp_ns / 1000000000, timestamp_ns % 1000000000);