From 34582733d9aad82bba60f4bf986b62d58412502a Mon Sep 17 00:00:00 2001 From: Alin Serdean Date: Mon, 25 Nov 2013 23:38:48 -0800 Subject: Avoid printf type modifiers not supported by MSVC C runtime library. The MSVC C library printf() implementation does not support the 'z', 't', 'j', or 'hh' format specifiers. This commit changes the Open vSwitch code to avoid those format specifiers, switching to standard macros from where available and inventing new macros resembling them where necessary. It also updates CodingStyle to specify the macros' use and adds a Makefile rule to report violations. Signed-off-by: Alin Serdean Co-authored-by: Ben Pfaff Signed-off-by: Ben Pfaff --- ovsdb/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ovsdb/log.c') diff --git a/ovsdb/log.c b/ovsdb/log.c index 131602576..ed72ca408 100644 --- a/ovsdb/log.c +++ b/ovsdb/log.c @@ -356,7 +356,7 @@ ovsdb_log_write(struct ovsdb_log *file, struct json *json) /* Compose header. */ sha1_bytes(json_string, length, sha1); - snprintf(header, sizeof header, "%s%zu "SHA1_FMT"\n", + snprintf(header, sizeof header, "%s%"PRIuSIZE" "SHA1_FMT"\n", magic, length, SHA1_ARGS(sha1)); /* Write. */ -- cgit v1.2.1