lib/sa_log.c: In function 'sa_log_timestamp':
lib/sa_log.c:179:4: error: format '%ld' expects argument of type 'long int',
but argument 4 has type 'long long unsigned int' [-Werror=format=]
ctime_buf + 11, (u_int64_t) t.tv_usec / 1000);
^
lib/sa_log.c:189:5: error: format '%ld' expects argument of type 'long int',
but argument 4 has type 'long long unsigned int' [-Werror=format=]
diff.tv_sec, (u_int64_t)diff.tv_usec / 1000);
^
cc1: all warnings being treated as errors
make[1]: *** [lib/sa_log.o] Error 1
make[1]: Leaving directory `/«PKGBUILDDIR»'
dh_auto_build: make -j1 returned exit code 2
make: *** [build-arch] Error 2
Signed-off-by: Robert Love <[email protected]>
---
lib/sa_log.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/sa_log.c b/lib/sa_log.c
index f6dfead..e970350 100644
--- a/lib/sa_log.c
+++ b/lib/sa_log.c
@@ -18,10 +18,14 @@
*/
#define _GNU_SOURCE /* for GNU definition of strerror_r */
+
+#include <inttypes.h>
+
#include "fcoemon_utils.h"
#include "net_types.h"
#include "fc_types.h"
+
int use_syslog;
static int debug;
@@ -169,8 +173,9 @@ sa_log_timestamp(void)
if (sa_log_flags & SA_LOGF_TIME) {
ctime_r(&t.tv_sec, ctime_buf);
ctime_buf[11 + 8] = '\0'; /* trim ctime after seconds */
- fprintf(stderr, "%s.%3.3ld",
- ctime_buf + 11, (u_int64_t) t.tv_usec / 1000);
+
+ fprintf(stderr, "%s.%3.3" PRIu64 "",
+ ctime_buf + 11, (u_int64_t)t.tv_usec / 1000);
}
if (sa_log_flags & SA_LOGF_DELTA) {
if (tlast.tv_sec == 0)
@@ -179,7 +184,7 @@ sa_log_timestamp(void)
tlast = t;
if (diff.tv_sec != 0 ||
diff.tv_usec >= sa_log_time_delta_min * 1000)
- fprintf(stderr, "%4ld.%3.3ld",
+ fprintf(stderr, "%4ld.%3.3" PRIu64 "",
diff.tv_sec, (u_int64_t)diff.tv_usec / 1000);
else
fprintf(stderr, "%8s ", "");
_______________________________________________
fcoe-devel mailing list
[email protected]
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel