blob: 00c57f0a37a8d17e614242feee1889ee6c8ccf82 [file] [log] [blame]
developer66e89bc2024-04-23 14:50:01 +08001From d6fd2757f7aab638022ffa635e32e21594ec382d Mon Sep 17 00:00:00 2001
2From: Stefan Weil <sw@weilnetz.de>
3Date: Sat, 21 Jan 2023 20:36:37 +0100
4Subject: [PATCH 05/28] iw: event: fix printf format error
5
6tv_usec can be a 64 bit integer which causes a compiler warning:
7
8event.c: In function 'print_event':
9event.c:930:41: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'suseconds_t' {aka 'long long int'} [-Wformat=]
10 930 | printf("[%s.%06lu]: ", buf, args->ts.tv_usec);
11 | ~~~~^ ~~~~~~~~~~~~~~~~
12 | | |
13 | long unsigned int suseconds_t {aka long long int}
14 | %06llu
15
16Signed-off-by: Stefan Weil <sw@weilnetz.de>
17Link: https://lore.kernel.org/r/20230121193637.347109-1-sw@weilnetz.de
18Signed-off-by: Johannes Berg <johannes.berg@intel.com>
19---
20 event.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/event.c b/event.c
24index 4c37297..fa2e125 100644
25--- a/event.c
26+++ b/event.c
27@@ -942,7 +942,7 @@ static int print_event(struct nl_msg *msg, void *arg)
28
29 memset(buf, 0, 255);
30 strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
31- printf("[%s.%06lu]: ", buf, args->ts.tv_usec);
32+ printf("[%s.%06lu]: ", buf, (unsigned long )args->ts.tv_usec);
33 } else {
34 printf("%llu.%06llu: ", usecs/1000000, usecs % 1000000);
35 }
36--
372.39.2
38