✘bad printf

Eric S. Raymond esr at thyrsus.com
Sat Dec 30 05:48:50 UTC 2017

Gary E. Miller via devel <devel at ntpsec.org>:
> Yo All!
> I'm getting a new issue on giy head;
> [ 97/132] Compiling ntpd/ntp_signd.c
> In file included from ../../include/ntp_stdlib.h:16:0,
>                  from ../../include/ntp.h:15,
>                  from ../../include/ntpd.h:11,
>                  from ../../ntpd/ntp_loopfilter.c:16:
> ../../ntpd/ntp_loopfilter.c: In function 'rstclock':
> ../../ntpd/ntp_loopfilter.c:1005:20: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'uptime_t {aka unsigned int}' [-Wformat=]
>          DPRINT(2, ("local_clock: mu %lu state %d poll %d count %d\n",
>                     ^
>       current_time - clock_epoch, trans, sys_poll,
>       ~~~~~~~~~~~~~~~~
> ../../include/ntp_debug.h:27:12: note: in definition of macro 'DPRINT'
>     mprintf arg;   \

I think a cast would be safe in this situation.
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: not available
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20171230/50b55abb/attachment.bin>

More information about the devel mailing list