]> git.ipfire.org Git - thirdparty/iproute2.git/commit
iproute2: fix build failure on sparc due to -Wformat and tv_usec
authorAndreas Henriksson <andreas@fatal.se>
Sat, 18 May 2013 06:18:51 +0000 (06:18 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 4 Jun 2013 02:56:25 +0000 (19:56 -0700)
commitc083d99dd3825e2f7a66d3e4717ed3fc6c42f351
tree706bc593a25c8fef3236d020ddfd6d131e6de172
parenta40d0827a58b3de39c8557db13f8a285813abd40
iproute2: fix build failure on sparc due to -Wformat and tv_usec

tv_usec is "suseconds_t" which is apparently usually
a signed long, but sometimes not....
Change the printf modifier to use signed and
cast the tv_usec to long in case it's not already long.

gcc -Wall -Wstrict-prototypes -Werror -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -fPIC   -c -o utils.o utils.c
utils.c: In function 'print_timestamp':
utils.c:802:2: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type '__suseconds_t' [-Werror=format]
cc1: all warnings being treated as errors

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
lib/utils.c