tv_usec can be a 64 bit integer which causes a compiler warning:
event.c: In function 'print_event':
event.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=]
930 | printf("[%s.%06lu]: ", buf, args->ts.tv_usec);
| ~~~~^ ~~~~~~~~~~~~~~~~
| | |
| long unsigned int suseconds_t {aka long long int}
| %06llu
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Link: https://lore.kernel.org/r/20230121193637.347109-1-sw@weilnetz.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
memset(buf, 0, 255);
strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
- printf("[%s.%06lu]: ", buf, args->ts.tv_usec);
+ printf("[%s.%06lu]: ", buf, (unsigned long )args->ts.tv_usec);
} else {
printf("%llu.%06llu: ", usecs/1000000, usecs % 1000000);
}