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 --- lib/ovsdb-data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/ovsdb-data.c') diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c index ade1971c3..4e918a6ab 100644 --- a/lib/ovsdb-data.c +++ b/lib/ovsdb-data.c @@ -741,12 +741,12 @@ check_string_constraints(const char *s, if (n_chars < c->minLen) { return ovsdb_error( "constraint violation", - "\"%s\" length %zu is less than minimum allowed " + "\"%s\" length %"PRIuSIZE" is less than minimum allowed " "length %u", s, n_chars, c->minLen); } else if (n_chars > c->maxLen) { return ovsdb_error( "constraint violation", - "\"%s\" length %zu is greater than maximum allowed " + "\"%s\" length %"PRIuSIZE" is greater than maximum allowed " "length %u", s, n_chars, c->maxLen); } @@ -1224,7 +1224,7 @@ ovsdb_datum_from_json__(struct ovsdb_datum *datum, n = inner->u.array.n; if (n < type->n_min || n > type->n_max) { return ovsdb_syntax_error(json, NULL, "%s must have %u to " - "%u members but %zu are present", + "%u members but %"PRIuSIZE" are present", class, type->n_min, type->n_max, n); } -- cgit v1.2.1