]> git.ipfire.org Git - thirdparty/kmod.git/commit
depmod: Fix warning with -D_TIME_BITS=64
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 11 Jun 2024 13:02:26 +0000 (08:02 -0500)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 11 Jun 2024 13:15:30 +0000 (08:15 -0500)
commit22c36b7dac45e75efc373e17e08a9cd4dc7dc41c
tree6244d82a931daa4741703b9c82ee831b1b88dbb3
parent68db6750788931da26018f2ee5c635cd58a4d809
depmod: Fix warning with -D_TIME_BITS=64

Printing time_t, suseconds_t, useconds_t in 32bits with -D_TIME_BITS=64
leads to the following warning:

../tools/depmod.c:2641:61: warning: format ‘%li’ expects argument of type ‘long int’, but argument 6 has type ‘__suseconds64_t’ {aka ‘long long int’} [-Wformat=]
 2641 |                         snprintf(tmp, sizeof(tmp), "%s.%i.%li.%li", itr->name, getpid(),
      |                                                           ~~^
      |                                                             |
      |                                                             long int
      |                                                           %lli
 2642 |                                         tv.tv_usec, tv.tv_sec);
      |                                         ~~~~~~~~~~

Paper it over by casting the argument to 64 bits and switching to long long.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/depmod.c