[ovs-dev] Windows port status

Alin Serdean aserdean at cloudbasesolutions.com
Fri Nov 22 02:23:11 UTC 2013


Bellow the whole patch required for the PRI_ZU macro:

diff --git a/CodingStyle b/CodingStyle
index 2f24ee3..a9417de 100644
--- a/CodingStyle
+++ b/CodingStyle
@@ -394,7 +394,7 @@ from <stdint.h>.
 integer types.  Use the PRId<N>, PRIu<N>, and PRIx<N> macros from
 <inttypes.h> for formatting them with printf() and related functions.

-  Use %zu to format size_t with printf().
+  Use "%"PRI_ZU to format size_t with printf().

   Use bit-fields sparingly.  Do not use bit-fields for layout of
 network protocol fields or in other circumstances where the exact
diff --git a/lib/bundle.c b/lib/bundle.c
index 7d00f87..c4318d1 100644
--- a/lib/bundle.c
+++ b/lib/bundle.c
@@ -165,8 +165,8 @@ bundle_from_openflow(const struct nx_action_bundle *nab,
     }
 
     if (slaves_size < bundle->n_slaves * sizeof(ovs_be16)) {
-        VLOG_WARN_RL(&rl, "Nicira action %"PRIu16" only has %zu bytes "
-                     "allocated for slaves.  %zu bytes are required for "
+        VLOG_WARN_RL(&rl, "Nicira action %"PRIu16" only has %"PRI_ZU" bytes "
+                     "allocated for slaves.  %"PRI_ZU" bytes are required for "
                      "%"PRIu16" slaves.", subtype, slaves_size,
                      bundle->n_slaves * sizeof(ovs_be16), bundle->n_slaves);
         error = OFPERR_OFPBAC_BAD_LEN;
diff --git a/lib/coverage.c b/lib/coverage.c
index 80316ef..f3189f6 100644
--- a/lib/coverage.c
+++ b/lib/coverage.c
@@ -255,7 +255,7 @@ coverage_read(struct svec *lines)
         }
     }
 
-    svec_add_nocopy(lines, xasprintf("%zu events never hit", n_never_hit));
+    svec_add_nocopy(lines, xasprintf("%"PRI_ZU" events never hit", n_never_hit));
     free(totals);
 }
 
diff --git a/lib/hmap.c b/lib/hmap.c
index a559a77..22f0f78 100644
--- a/lib/hmap.c
+++ b/lib/hmap.c
@@ -114,7 +114,7 @@ resize(struct hmap *hmap, size_t new_mask, const char *where)
         if (count > 5) {
             static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(10, 10);
             COVERAGE_INC(hmap_pathological);
-            VLOG_DBG_RL(&rl, "%s: %d nodes in bucket (%zu nodes, %zu buckets)",
+            VLOG_DBG_RL(&rl, "%s: %d nodes in bucket (%"PRI_ZU" nodes, %"PRI_ZU" buckets)",
                         where, count, hmap->n, hmap->mask + 1);
         }
     }
diff --git a/lib/multipath.c b/lib/multipath.c
index 4b9e4af..5aeb088 100644
--- a/lib/multipath.c
+++ b/lib/multipath.c
@@ -63,7 +63,7 @@ multipath_from_openflow(const struct nx_action_multipath *nam,
         VLOG_WARN_RL(&rl, "unsupported algorithm %d", (int) mp->algorithm);
         return OFPERR_OFPBAC_BAD_ARGUMENT;
     } else if (mp->dst.n_bits < min_n_bits) {
-        VLOG_WARN_RL(&rl, "multipath action requires at least %zu bits for "
+        VLOG_WARN_RL(&rl, "multipath action requires at least %"PRI_ZU" bits for "
                      "%"PRIu32" links", min_n_bits, n_links);
         return OFPERR_OFPBAC_BAD_ARGUMENT;
     }
diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c
index 3eb29ea..56a4c93 100644
--- a/lib/netdev-bsd.c
+++ b/lib/netdev-bsd.c
@@ -703,7 +703,7 @@ netdev_bsd_send(struct netdev *netdev_, const void *data, size_t size)
             }
         } else if (retval != size) {
             VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%zd bytes of "
-                         "%zu) on %s", retval, size, name);
+                         "%"PRI_ZU") on %s", retval, size, name);
             error = EMSGSIZE;
         } else {
             break;
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index ae0e5a0..f3a580a 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -976,7 +976,7 @@ netdev_linux_send(struct netdev *netdev_, const void *data, size_t size)
             return errno;
         } else if (retval != size) {
             VLOG_WARN_RL(&rl, "sent partial Ethernet packet (%zd bytes of "
-                         "%zu) on %s", retval, size, netdev_get_name(netdev_));
+                         "%"PRI_ZU") on %s", retval, size, netdev_get_name(netdev_));
             return EMSGSIZE;
         } else {
             return 0;
diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index 3420503..1ec3724 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -337,7 +337,7 @@ nl_sock_recv__(struct nl_sock *sock, struct ofpbuf *buf, bool wait)
     }
 
     if (msg.msg_flags & MSG_TRUNC) {
-        VLOG_ERR_RL(&rl, "truncated message (longer than %zu bytes)",
+        VLOG_ERR_RL(&rl, "truncated message (longer than %"PRI_ZU" bytes)",
                     sizeof tail);
         return E2BIG;
     }
@@ -346,7 +346,7 @@ nl_sock_recv__(struct nl_sock *sock, struct ofpbuf *buf, bool wait)
     if (retval < sizeof *nlmsghdr
         || nlmsghdr->nlmsg_len < sizeof *nlmsghdr
         || nlmsghdr->nlmsg_len > retval) {
-        VLOG_ERR_RL(&rl, "received invalid nlmsg (%zd bytes < %zu)",
+        VLOG_ERR_RL(&rl, "received invalid nlmsg (%zd bytes < %"PRI_ZU")",
                     retval, sizeof *nlmsghdr);
         return EPROTO;
     }
diff --git a/lib/netlink.c b/lib/netlink.c
index 680c676..3a1468c 100644
--- a/lib/netlink.c
+++ b/lib/netlink.c
@@ -690,8 +690,8 @@ nl_attr_validate(const struct nlattr *nla, const struct nl_policy *policy)
     /* Verify length. */
     len = nl_attr_get_size(nla);
     if (len < min_len || len > max_len) {
-        VLOG_DBG_RL(&rl, "attr %"PRIu16" length %zu not in "
-                    "allowed range %zu...%zu", type, len, min_len, max_len);
+        VLOG_DBG_RL(&rl, "attr %"PRIu16" length %"PRI_ZU" not in "
+                    "allowed range %"PRI_ZU"...%"PRI_ZU, type, len, min_len, max_len);
         return false;
     }
 
@@ -756,7 +756,7 @@ nl_policy_parse(const struct ofpbuf *msg, size_t nla_offset,
     for (i = 0; i < n_attrs; i++) {
         const struct nl_policy *e = &policy[i];
         if (!e->optional && e->type != NL_A_NO_ATTR && !attrs[i]) {
-            VLOG_DBG_RL(&rl, "required attr %zu missing", i);
+            VLOG_DBG_RL(&rl, "required attr %"PRI_ZU" missing", i);
             return false;
         }
     }
diff --git a/lib/nx-match.c b/lib/nx-match.c
index 72fc00f..bfbd691 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -215,7 +215,7 @@ nx_pull_match__(struct ofpbuf *b, unsigned int match_len, bool strict,
         if (!p) {
             VLOG_DBG_RL(&rl, "nx_match length %u, rounded up to a "
                         "multiple of 8, is longer than space in message (max "
-                        "length %zu)", match_len, b->size);
+                        "length %"PRI_ZU")", match_len, b->size);
             return OFPERR_OFPBMC_BAD_LEN;
         }
     }
@@ -272,7 +272,7 @@ oxm_pull_match__(struct ofpbuf *b, bool strict, struct match *match)
     if (!p) {
         VLOG_DBG_RL(&rl, "oxm length %u, rounded up to a "
                     "multiple of 8, is longer than space in message (max "
-                    "length %zu)", match_len, b->size);
+                    "length %"PRI_ZU")", match_len, b->size);
         return OFPERR_OFPBMC_BAD_LEN;
     }
 
diff --git a/lib/odp-util.c b/lib/odp-util.c
index 62cc638..7eb2746 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -378,7 +378,7 @@ format_odp_action(struct ds *ds, const struct nlattr *a)
 
     expected_len = odp_action_len(nl_attr_type(a));
     if (expected_len != -2 && nl_attr_get_size(a) != expected_len) {
-        ds_put_format(ds, "bad length %zu, expected %d for: ",
+        ds_put_format(ds, "bad length %"PRI_ZU", expected %d for: ",
                       nl_attr_get_size(a), expected_len);
         format_generic_odp_action(ds, a);
         return;
@@ -977,14 +977,14 @@ format_odp_key_attr(const struct nlattr *a, const struct nlattr *ma,
 
             if (bad_key_len || bad_mask_len) {
                 if (bad_key_len) {
-                    ds_put_format(ds, "(bad key length %zu, expected %d)(",
+                    ds_put_format(ds, "(bad key length %"PRI_ZU", expected %d)(",
                                   nl_attr_get_size(a),
                                   odp_flow_key_attr_len(nl_attr_type(a)));
                 }
                 format_generic_odp_key(a, ds);
                 if (bad_mask_len) {
                     ds_put_char(ds, '/');
-                    ds_put_format(ds, "(bad mask length %zu, expected %d)(",
+                    ds_put_format(ds, "(bad mask length %"PRI_ZU", expected %d)(",
                                   nl_attr_get_size(ma),
                                   odp_flow_key_attr_len(nl_attr_type(ma)));
                 }
@@ -2676,7 +2676,7 @@ parse_flow_nlattrs(const struct nlattr *key, size_t key_len,
         if (len != expected_len && expected_len >= 0) {
             char namebuf[OVS_KEY_ATTR_BUFSIZE];
 
-            VLOG_ERR_RL(&rl, "attribute %s has length %zu but should have "
+            VLOG_ERR_RL(&rl, "attribute %s has length %"PRI_ZU" but should have "
                         "length %d", ovs_key_attr_to_string(type, namebuf,
                                                             sizeof namebuf),
                         len, expected_len);
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index e07ea1d..3c8f564 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -248,8 +248,8 @@ dec_ttl_cnt_ids_from_openflow(const struct nx_action_cnt_ids *nac_ids,
     }
 
     if (ids_size < ids->n_controllers * sizeof(ovs_be16)) {
-        VLOG_WARN_RL(&rl, "Nicira action dec_ttl_cnt_ids only has %zu bytes "
-                     "allocated for controller ids.  %zu bytes are required for "
+        VLOG_WARN_RL(&rl, "Nicira action dec_ttl_cnt_ids only has %"PRI_ZU" bytes "
+                     "allocated for controller ids.  %"PRI_ZU" bytes are required for "
                      "%"PRIu16" controllers.", ids_size,
                      ids->n_controllers * sizeof(ovs_be16), ids->n_controllers);
         return OFPERR_OFPBAC_BAD_LEN;
@@ -711,7 +711,7 @@ ofpacts_pull_openflow_actions(struct ofpbuf *openflow,
     actions = ofpbuf_try_pull(openflow, actions_len);
     if (actions == NULL) {
         VLOG_WARN_RL(&rl, "OpenFlow message actions length %u exceeds "
-                     "remaining message length (%zu)",
+                     "remaining message length (%"PRI_ZU")",
                      actions_len, openflow->size);
         return OFPERR_OFPBRC_BAD_LEN;
     }
@@ -1715,7 +1715,7 @@ decode_openflow11_instructions(const struct ofp11_instruction insts[],
     }
 
     if (left) {
-        VLOG_WARN_RL(&rl, "bad instruction format at offset %zu",
+        VLOG_WARN_RL(&rl, "bad instruction format at offset %"PRI_ZU,
                      (n_insts - left) * sizeof *inst);
         return OFPERR_OFPBIC_BAD_LEN;
     }
@@ -1754,7 +1754,7 @@ ofpacts_pull_openflow_instructions(struct ofpbuf *openflow,
     instructions = ofpbuf_try_pull(openflow, instructions_len);
     if (instructions == NULL) {
         VLOG_WARN_RL(&rl, "OpenFlow message instructions length %u exceeds "
-                     "remaining message length (%zu)",
+                     "remaining message length (%"PRI_ZU")",
                      instructions_len, openflow->size);
         error = OFPERR_OFPBIC_BAD_LEN;
         goto exit;
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 37e1f4f..c4a9d88 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -109,7 +109,7 @@ ofp_print_packet_in(struct ds *string, const struct ofp_header *oh,
         ds_put_format(string, " cookie=0x%"PRIx64, ntohll(pin.cookie));
     }
 
-    ds_put_format(string, " total_len=%zu in_port=", pin.total_len);
+    ds_put_format(string, " total_len=%"PRI_ZU" in_port=", pin.total_len);
     ofputil_format_port(pin.fmd.in_port, string);
 
     if (pin.fmd.tun_id != htonll(0)) {
@@ -142,7 +142,7 @@ ofp_print_packet_in(struct ds *string, const struct ofp_header *oh,
                   ofputil_packet_in_reason_to_string(pin.reason, reasonbuf,
                                                      sizeof reasonbuf));
 
-    ds_put_format(string, " data_len=%zu", pin.packet_len);
+    ds_put_format(string, " data_len=%"PRI_ZU, pin.packet_len);
     if (pin.buffer_id == UINT32_MAX) {
         ds_put_format(string, " (unbuffered)");
         if (pin.total_len != pin.packet_len) {
@@ -189,7 +189,7 @@ ofp_print_packet_out(struct ds *string, const struct ofp_header *oh,
     ofpacts_format(po.ofpacts, po.ofpacts_len, string);
 
     if (po.buffer_id == UINT32_MAX) {
-        ds_put_format(string, " data_len=%zu", po.packet_len);
+        ds_put_format(string, " data_len=%"PRI_ZU, po.packet_len);
         if (verbosity > 0 && po.packet_len > 0) {
             char *packet = ofp_packet_to_string(po.packet, po.packet_len);
             ds_put_char(string, '\n');
@@ -1533,7 +1533,7 @@ ofp_print_ofpst_port_reply(struct ds *string, const struct ofp_header *oh,
 {
     struct ofpbuf b;
 
-    ds_put_format(string, " %zu ports\n", ofputil_count_port_stats(oh));
+    ds_put_format(string, " %"PRI_ZU" ports\n", ofputil_count_port_stats(oh));
     if (verbosity < 1) {
         return;
     }
@@ -1647,7 +1647,7 @@ ofp_print_ofpst_table_reply13(struct ds *string, const struct ofp_header *oh,
     ofpraw_pull_assert(&b);
 
     n = b.size / sizeof *ts;
-    ds_put_format(string, " %zu tables\n", n);
+    ds_put_format(string, " %"PRI_ZU" tables\n", n);
     if (verbosity < 1) {
         return;
     }
@@ -1677,7 +1677,7 @@ ofp_print_ofpst_table_reply12(struct ds *string, const struct ofp_header *oh,
     ofpraw_pull_assert(&b);
 
     n = b.size / sizeof *ts;
-    ds_put_format(string, " %zu tables\n", n);
+    ds_put_format(string, " %"PRI_ZU" tables\n", n);
     if (verbosity < 1) {
         return;
     }
@@ -1704,7 +1704,7 @@ ofp_print_ofpst_table_reply11(struct ds *string, const struct ofp_header *oh,
     ofpraw_pull_assert(&b);
 
     n = b.size / sizeof *ts;
-    ds_put_format(string, " %zu tables\n", n);
+    ds_put_format(string, " %"PRI_ZU" tables\n", n);
     if (verbosity < 1) {
         return;
     }
@@ -1744,7 +1744,7 @@ ofp_print_ofpst_table_reply10(struct ds *string, const struct ofp_header *oh,
     ofpraw_pull_assert(&b);
 
     n = b.size / sizeof *ts;
-    ds_put_format(string, " %zu tables\n", n);
+    ds_put_format(string, " %"PRI_ZU" tables\n", n);
     if (verbosity < 1) {
         return;
     }
@@ -1828,7 +1828,7 @@ ofp_print_ofpst_queue_reply(struct ds *string, const struct ofp_header *oh,
 {
     struct ofpbuf b;
 
-    ds_put_format(string, " %zu queues\n", ofputil_count_queue_stats(oh));
+    ds_put_format(string, " %"PRI_ZU" queues\n", ofputil_count_queue_stats(oh));
     if (verbosity < 1) {
         return;
     }
@@ -1911,7 +1911,7 @@ ofp_print_echo(struct ds *string, const struct ofp_header *oh, int verbosity)
 {
     size_t len = ntohs(oh->length);
 
-    ds_put_format(string, " %zu bytes of payload\n", len - sizeof *oh);
+    ds_put_format(string, " %"PRI_ZU" bytes of payload\n", len - sizeof *oh);
     if (verbosity > 1) {
         ds_put_hex_dump(string, oh + 1, len - sizeof *oh, 0, true);
     }
@@ -2746,7 +2746,7 @@ ofp_to_string(const void *oh_, size_t len, int verbosity)
     if (!len) {
         ds_put_cstr(&string, "OpenFlow message is empty\n");
     } else if (len < sizeof(struct ofp_header)) {
-        ds_put_format(&string, "OpenFlow packet too short (only %zu bytes):\n",
+        ds_put_format(&string, "OpenFlow packet too short (only %"PRI_ZU" bytes):\n",
                       len);
     } else if (ntohs(oh->length) > len) {
         enum ofperr error;
@@ -2759,11 +2759,11 @@ ofp_to_string(const void *oh_, size_t len, int verbosity)
         }
 
         ds_put_format(&string,
-                      "(***truncated to %zu bytes from %"PRIu16"***)\n",
+                      "(***truncated to %"PRI_ZU" bytes from %"PRIu16"***)\n",
                       len, ntohs(oh->length));
     } else if (ntohs(oh->length) < len) {
         ds_put_format(&string,
-                      "(***only uses %"PRIu16" bytes out of %zu***)\n",
+                      "(***only uses %"PRIu16" bytes out of %"PRI_ZU"***)\n",
                       ntohs(oh->length), len);
     } else {
         enum ofperr error;
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index d8a9754..eb9e488 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -1901,7 +1901,7 @@ ofputil_decode_meter_config(struct ofpbuf *msg,
     omc = ofpbuf_try_pull(msg, sizeof *omc);
     if (!omc) {
         VLOG_WARN_RL(&bad_ofmsg_rl,
-                     "OFPMP_METER_CONFIG reply has %zu leftover bytes at end",
+                     "OFPMP_METER_CONFIG reply has %"PRI_ZU" leftover bytes at end",
                      msg->size);
         return OFPERR_OFPBRC_BAD_LEN;
     }
@@ -1977,7 +1977,7 @@ ofputil_decode_meter_stats(struct ofpbuf *msg,
     oms = ofpbuf_try_pull(msg, sizeof *oms);
     if (!oms) {
         VLOG_WARN_RL(&bad_ofmsg_rl,
-                     "OFPMP_METER reply has %zu leftover bytes at end",
+                     "OFPMP_METER reply has %"PRI_ZU" leftover bytes at end",
                      msg->size);
         return OFPERR_OFPBRC_BAD_LEN;
     }
@@ -2668,7 +2668,7 @@ ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *fs,
 
         ofs = ofpbuf_try_pull(msg, sizeof *ofs);
         if (!ofs) {
-            VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply has %zu leftover "
+            VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply has %"PRI_ZU" leftover "
                          "bytes at end", msg->size);
             return EINVAL;
         }
@@ -2676,7 +2676,7 @@ ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *fs,
         length = ntohs(ofs->length);
         if (length < sizeof *ofs) {
             VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply claims invalid "
-                         "length %zu", length);
+                         "length %"PRI_ZU, length);
             return EINVAL;
         }
 
@@ -2718,7 +2718,7 @@ ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *fs,
 
         ofs = ofpbuf_try_pull(msg, sizeof *ofs);
         if (!ofs) {
-            VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply has %zu leftover "
+            VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply has %"PRI_ZU" leftover "
                          "bytes at end", msg->size);
             return EINVAL;
         }
@@ -2726,7 +2726,7 @@ ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *fs,
         length = ntohs(ofs->length);
         if (length < sizeof *ofs) {
             VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_FLOW reply claims invalid "
-                         "length %zu", length);
+                         "length %"PRI_ZU, length);
             return EINVAL;
         }
 
@@ -2754,7 +2754,7 @@ ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *fs,
 
         nfs = ofpbuf_try_pull(msg, sizeof *nfs);
         if (!nfs) {
-            VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW reply has %zu leftover "
+            VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW reply has %"PRI_ZU" leftover "
                          "bytes at end", msg->size);
             return EINVAL;
         }
@@ -2762,8 +2762,8 @@ ofputil_decode_flow_stats_reply(struct ofputil_flow_stats *fs,
         length = ntohs(nfs->length);
         match_len = ntohs(nfs->match_len);
         if (length < sizeof *nfs + ROUND_UP(match_len, 8)) {
-            VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW reply with match_len=%zu "
-                         "claims invalid length %zu", match_len, length);
+            VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW reply with match_len=%"PRI_ZU" "
+                         "claims invalid length %"PRI_ZU, match_len, length);
             return EINVAL;
         }
         if (nx_pull_match(msg, match_len, &fs->match, NULL, NULL)) {
@@ -4478,7 +4478,7 @@ ofputil_decode_flow_monitor_request(struct ofputil_flow_monitor_request *rq,
 
     nfmr = ofpbuf_try_pull(msg, sizeof *nfmr);
     if (!nfmr) {
-        VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW_MONITOR request has %zu "
+        VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW_MONITOR request has %"PRI_ZU" "
                      "leftover bytes at end", msg->size);
         return OFPERR_OFPBRC_BAD_LEN;
     }
@@ -4632,7 +4632,7 @@ ofputil_decode_flow_update(struct ofputil_flow_update *update,
     }
 
 bad_len:
-    VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW_MONITOR reply has %zu "
+    VLOG_WARN_RL(&bad_ofmsg_rl, "NXST_FLOW_MONITOR reply has %"PRI_ZU" "
                  "leftover bytes at end", msg->size);
     return OFPERR_OFPBRC_BAD_LEN;
 }
@@ -5656,7 +5656,7 @@ ofputil_decode_port_stats(struct ofputil_port_stats *ps, struct ofpbuf *msg)
     }
 
  bad_len:
-    VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_PORT reply has %zu leftover "
+    VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_PORT reply has %"PRI_ZU" leftover "
                  "bytes at end", msg->size);
     return OFPERR_OFPBRC_BAD_LEN;
 }
@@ -5966,13 +5966,13 @@ ofputil_decode_group_stats_reply(struct ofpbuf *msg,
     }
 
     if (!ogs11) {
-        VLOG_WARN_RL(&bad_ofmsg_rl, "%s reply has %zu leftover bytes at end",
+        VLOG_WARN_RL(&bad_ofmsg_rl, "%s reply has %"PRI_ZU" leftover bytes at end",
                      ofpraw_get_name(raw), msg->size);
         return OFPERR_OFPBRC_BAD_LEN;
     }
     length = ntohs(ogs11->length);
     if (length < sizeof base_len) {
-        VLOG_WARN_RL(&bad_ofmsg_rl, "%s reply claims invalid length %zu",
+        VLOG_WARN_RL(&bad_ofmsg_rl, "%s reply claims invalid length %"PRI_ZU,
                      ofpraw_get_name(raw), length);
         return OFPERR_OFPBRC_BAD_LEN;
     }
@@ -5985,7 +5985,7 @@ ofputil_decode_group_stats_reply(struct ofpbuf *msg,
     gs->n_buckets = (length - base_len) / sizeof *obc;
     obc = ofpbuf_try_pull(msg, gs->n_buckets * sizeof *obc);
     if (!obc) {
-        VLOG_WARN_RL(&bad_ofmsg_rl, "%s reply has %zu leftover bytes at end",
+        VLOG_WARN_RL(&bad_ofmsg_rl, "%s reply has %"PRI_ZU" leftover bytes at end",
                      ofpraw_get_name(raw), msg->size);
         return OFPERR_OFPBRC_BAD_LEN;
     }
@@ -6054,18 +6054,18 @@ ofputil_pull_buckets(struct ofpbuf *msg, size_t buckets_length,
               ? ofpbuf_try_pull(msg, sizeof *ob)
               : NULL);
         if (!ob) {
-            VLOG_WARN_RL(&bad_ofmsg_rl, "buckets end with %zu leftover bytes",
+            VLOG_WARN_RL(&bad_ofmsg_rl, "buckets end with %"PRI_ZU" leftover bytes",
                          buckets_length);
         }
 
         ob_len = ntohs(ob->len);
         if (ob_len < sizeof *ob) {
             VLOG_WARN_RL(&bad_ofmsg_rl, "OpenFlow message bucket length "
-                         "%zu is not valid", ob_len);
+                         "%"PRI_ZU" is not valid", ob_len);
             return OFPERR_OFPGMFC_BAD_BUCKET;
         } else if (ob_len > buckets_length) {
             VLOG_WARN_RL(&bad_ofmsg_rl, "OpenFlow message bucket length "
-                         "%zu exceeds remaining buckets data size %zu",
+                         "%"PRI_ZU" exceeds remaining buckets data size %"PRI_ZU,
                          ob_len, buckets_length);
             return OFPERR_OFPGMFC_BAD_BUCKET;
         }
@@ -6124,7 +6124,7 @@ ofputil_decode_group_desc_reply(struct ofputil_group_desc *gd,
 
     ogds = ofpbuf_try_pull(msg, sizeof *ogds);
     if (!ogds) {
-        VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply has %zu "
+        VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply has %"PRI_ZU" "
                      "leftover bytes at end", msg->size);
         return OFPERR_OFPBRC_BAD_LEN;
     }
@@ -6134,7 +6134,7 @@ ofputil_decode_group_desc_reply(struct ofputil_group_desc *gd,
     length = ntohs(ogds->length);
     if (length < sizeof *ogds || length - sizeof *ogds > msg->size) {
         VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST11_GROUP_DESC reply claims invalid "
-                     "length %zu", length);
+                     "length %"PRI_ZU, length);
         return OFPERR_OFPBRC_BAD_LEN;
     }
 
@@ -6450,7 +6450,7 @@ ofputil_decode_queue_stats(struct ofputil_queue_stats *qs, struct ofpbuf *msg)
     }
 
  bad_len:
-    VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_QUEUE reply has %zu leftover "
+    VLOG_WARN_RL(&bad_ofmsg_rl, "OFPST_QUEUE reply has %"PRI_ZU" leftover "
                  "bytes at end", msg->size);
     return OFPERR_OFPBRC_BAD_LEN;
 }
diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c
index d578ab5..15861e6 100644
--- a/lib/ofpbuf.c
+++ b/lib/ofpbuf.c
@@ -553,7 +553,7 @@ ofpbuf_to_string(const struct ofpbuf *b, size_t maxbytes)
     struct ds s;
 
     ds_init(&s);
-    ds_put_format(&s, "size=%zu, allocated=%zu, head=%zu, tail=%zu\n",
+    ds_put_format(&s, "size=%"PRI_ZU", allocated=%"PRI_ZU", head=%"PRI_ZU", tail=%"PRI_ZU"\n",
                   b->size, b->allocated,
                   ofpbuf_headroom(b), ofpbuf_tailroom(b));
     ds_put_hex_dump(&s, b->data, MIN(b->size, maxbytes), 0, false);
diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
index ade1971..044f095 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 %"PRI_ZU" 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 %"PRI_ZU" 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 %"PRI_ZU" are present",
                                       class, type->n_min, type->n_max, n);
         }
 
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 3366523..48e1ecd 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -2105,7 +2105,7 @@ ovsdb_idl_txn_process_inc_reply(struct ovsdb_idl_txn *txn,
 
     if (txn->inc_index + 2 > results->n) {
         VLOG_WARN_RL(&syntax_rl, "reply does not contain enough operations "
-                     "for increment (has %zu, needs %u)",
+                     "for increment (has %"PRI_ZU", needs %u)",
                      results->n, txn->inc_index + 2);
         return false;
     }
@@ -2130,7 +2130,7 @@ ovsdb_idl_txn_process_inc_reply(struct ovsdb_idl_txn *txn,
         return false;
     }
     if (rows->u.array.n != 1) {
-        VLOG_WARN_RL(&syntax_rl, "\"select\" reply \"rows\" has %zu elements "
+        VLOG_WARN_RL(&syntax_rl, "\"select\" reply \"rows\" has %"PRI_ZU" elements "
                      "instead of 1",
                      rows->u.array.n);
         return false;
@@ -2160,7 +2160,7 @@ ovsdb_idl_txn_process_insert_reply(struct ovsdb_idl_txn_insert *insert,
 
     if (insert->op_index >= results->n) {
         VLOG_WARN_RL(&syntax_rl, "reply does not contain enough operations "
-                     "for insert (has %zu, needs %u)",
+                     "for insert (has %"PRI_ZU", needs %u)",
                      results->n, insert->op_index);
         return false;
     }
diff --git a/lib/ovsdb-parser.c b/lib/ovsdb-parser.c
index 77460a8..956d64e 100644
--- a/lib/ovsdb-parser.c
+++ b/lib/ovsdb-parser.c
@@ -142,7 +142,7 @@ ovsdb_parser_finish(struct ovsdb_parser *parser)
                     if (n_unused > 1) {
                         ovsdb_parser_raise_error(
                             parser,
-                            "Member '%s' and %zu other member%s "
+                            "Member '%s' and %"PRI_ZU" other member%s "
                             "are present but not allowed here.",
                             node->name, n_unused - 1, n_unused > 2 ? "s" : "");
                     } else {
diff --git a/lib/pcap-file.c b/lib/pcap-file.c
index 700cdea..02bd2ab 100644
--- a/lib/pcap-file.c
+++ b/lib/pcap-file.c
@@ -156,7 +156,7 @@ pcap_read(FILE *file, struct ofpbuf **bufp)
                                 ((len & 0x0000ff00) <<  8) |
                                 ((len & 0x000000ff) << 24));
         if (swapped_len > 0xffff) {
-            VLOG_WARN("bad packet length %zu or %"PRIu32" "
+            VLOG_WARN("bad packet length %"PRI_ZU" or %"PRIu32" "
                       "reading pcap file",
                       len, swapped_len);
             return EPROTO;
diff --git a/lib/socket-util.c b/lib/socket-util.c
index cd0affc..4897632 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -473,7 +473,7 @@ make_sockaddr_un(const char *name, struct sockaddr_un *un, socklen_t *un_len,
             static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
 
             VLOG_WARN_RL(&rl, "Unix socket name %s is longer than maximum "
-                         "%zu bytes", name, MAX_UN_LEN);
+                         "%"PRI_ZU" bytes", name, MAX_UN_LEN);
             return error;
         }
 
@@ -1050,7 +1050,7 @@ getsockopt_int(int fd, int level, int option, const char *optname, int *valuep)
         VLOG_ERR_RL(&rl, "getsockopt(%s): %s", optname, ovs_strerror(error));
     } else if (len != sizeof value) {
         error = EINVAL;
-        VLOG_ERR_RL(&rl, "getsockopt(%s): value is %u bytes (expected %zu)",
+        VLOG_ERR_RL(&rl, "getsockopt(%s): value is %u bytes (expected %"PRI_ZU")",
                     optname, (unsigned int) len, sizeof value);
     } else {
         error = 0;
@@ -1419,7 +1419,7 @@ recv_data_and_fds(int sock,
 
             ovs_assert(n_fds > 0);
             if (n_fds > SOUTIL_MAX_FDS) {
-                VLOG_ERR("%zu fds received but only %d supported",
+                VLOG_ERR("%"PRI_ZU" fds received but only %d supported",
                          n_fds, SOUTIL_MAX_FDS);
                 for (i = 0; i < n_fds; i++) {
                     close(fds_data[i]);
diff --git a/lib/stp.c b/lib/stp.c
index 6e1efd0..f0d44ad 100644
--- a/lib/stp.c
+++ b/lib/stp.c
@@ -727,7 +727,7 @@ stp_received_bpdu(struct stp_port *p, const void *bpdu, size_t bpdu_size)
     }
 
     if (bpdu_size < sizeof(struct stp_bpdu_header)) {
-        VLOG_WARN("%s: received runt %zu-byte BPDU", stp->name, bpdu_size);
+        VLOG_WARN("%s: received runt %"PRI_ZU"-byte BPDU", stp->name, bpdu_size);
         p->error_count++;
         goto out;
     }
@@ -747,7 +747,7 @@ stp_received_bpdu(struct stp_port *p, const void *bpdu, size_t bpdu_size)
     switch (header->bpdu_type) {
     case STP_TYPE_CONFIG:
         if (bpdu_size < sizeof(struct stp_config_bpdu)) {
-            VLOG_WARN("%s: received config BPDU with invalid size %zu",
+            VLOG_WARN("%s: received config BPDU with invalid size %"PRI_ZU,
                       stp->name, bpdu_size);
             p->error_count++;
             goto out;
@@ -757,7 +757,7 @@ stp_received_bpdu(struct stp_port *p, const void *bpdu, size_t bpdu_size)
 
     case STP_TYPE_TCN:
         if (bpdu_size != sizeof(struct stp_tcn_bpdu)) {
-            VLOG_WARN("%s: received TCN BPDU with invalid size %zu",
+            VLOG_WARN("%s: received TCN BPDU with invalid size %"PRI_ZU,
                       stp->name, bpdu_size);
             p->error_count++;
             goto out;
diff --git a/lib/stream-ssl.c b/lib/stream-ssl.c
index 1e748c0..b3eed86 100644
--- a/lib/stream-ssl.c
+++ b/lib/stream-ssl.c
@@ -1247,7 +1247,7 @@ stream_ssl_set_ca_cert_file__(const char *file_name,
         for (i = 0; i < n_certs; i++) {
             /* SSL_CTX_add_client_CA makes a copy of the relevant data. */
             if (SSL_CTX_add_client_CA(ctx, certs[i]) != 1) {
-                VLOG_ERR("failed to add client certificate %zu from %s: %s",
+                VLOG_ERR("failed to add client certificate %"PRI_ZU" from %s: %s",
                          i, file_name,
                          ERR_error_string(ERR_get_error(), NULL));
             } else {
@@ -1369,7 +1369,7 @@ ssl_protocol_cb(int write_p, int version OVS_UNUSED, int content_type,
         ds_put_format(&details, "type %d", content_type);
     }
 
-    VLOG_DBG("%s%u%s%s %s (%zu bytes)",
+    VLOG_DBG("%s%u%s%s %s (%"PRI_ZU" bytes)",
              sslv->type == CLIENT ? "client" : "server",
              sslv->session_nr, write_p ? "-->" : "<--",
              stream_get_name(&sslv->stream), ds_cstr(&details), len);
diff --git a/m4/openvswitch.m4 b/m4/openvswitch.m4
index 7c37985..fe982f2 100644
--- a/m4/openvswitch.m4
+++ b/m4/openvswitch.m4
@@ -64,6 +64,9 @@ AC_DEFUN([OVS_CHECK_WIN32],
    AM_CONDITIONAL([WIN32], [test "$WIN32" = yes])
    if test "$WIN32" = yes; then
       AC_DEFINE([WIN32], [1], [Define to 1 if building on WIN32.])
+      AC_DEFINE([PRI_ZU], ["Iu"], [size_t specification if compiling on WIN32 for more information see http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.])
+   else
+      AC_DEFINE([PRI_ZU], ["zu"], [size_t specification C99.])
    fi])
 
 dnl Checks for Netlink support.
diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index dba3d3b..198131a 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -462,7 +462,7 @@ classify_upcall(const struct upcall *upcall)
     userdata_len = nl_attr_get_size(dpif_upcall->userdata);
     if (userdata_len < sizeof cookie.type
         || userdata_len > sizeof cookie) {
-        VLOG_WARN_RL(&rl, "action upcall cookie has unexpected size %zu",
+        VLOG_WARN_RL(&rl, "action upcall cookie has unexpected size %"PRI_ZU,
                      userdata_len);
         return BAD_UPCALL;
     }
@@ -482,7 +482,7 @@ classify_upcall(const struct upcall *upcall)
         return IPFIX_UPCALL;
     } else {
         VLOG_WARN_RL(&rl, "invalid user cookie of type %"PRIu16
-                     " and size %zu", cookie.type, userdata_len);
+                     " and size %"PRI_ZU, cookie.type, userdata_len);
         return BAD_UPCALL;
     }
 }
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index c1c206b..58534bb 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5241,7 +5241,7 @@ trace_format_regs(struct ds *result, int level, const char *title,
     ds_put_char_multiple(result, '\t', level);
     ds_put_format(result, "%s:", title);
     for (i = 0; i < FLOW_N_REGS; i++) {
-        ds_put_format(result, " reg%zu=0x%"PRIx32, i, trace->flow.regs[i]);
+        ds_put_format(result, " reg%"PRI_ZU"=0x%"PRIx32, i, trace->flow.regs[i]);
     }
     ds_put_char(result, '\n');
 }
@@ -5734,7 +5734,7 @@ dpif_show_backer(const struct dpif_backer *backer, struct ds *ds)
 
     ds_put_format(ds, "%s: hit:%"PRIu64" missed:%"PRIu64"\n",
                   dpif_name(backer->dpif), n_hit, n_missed);
-    ds_put_format(ds, "\tflows: cur: %zu, avg: %u, max: %u,"
+    ds_put_format(ds, "\tflows: cur: %"PRI_ZU", avg: %u, max: %u,"
                   " life span: %lldms\n", hmap_count(&backer->subfacets),
                   backer->avg_n_subfacet, backer->max_n_subfacet,
                   backer->avg_subfacet_life);
@@ -5845,7 +5845,7 @@ ofproto_unixctl_dpif_dump_megaflows(struct unixctl_conn *conn,
     CLS_CURSOR_FOR_EACH (facet, cr, &cursor) {
         cls_rule_format(&facet->cr, &ds);
         ds_put_cstr(&ds, ", ");
-        ds_put_format(&ds, "n_subfacets:%zu, ", list_size(&facet->subfacets));
+        ds_put_format(&ds, "n_subfacets:%"PRI_ZU", ", list_size(&facet->subfacets));
         ds_put_format(&ds, "used:%.3fs, ", (now - facet->used) / 1000.0);
         ds_put_cstr(&ds, "Datapath actions: ");
         if (facet->xout.slow) {
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 5cd6b1e..33c538b 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -3061,7 +3061,7 @@ handle_table_stats_request(struct ofconn *ofconn,
     ots = xcalloc(p->n_tables, sizeof *ots);
     for (i = 0; i < p->n_tables; i++) {
         ots[i].table_id = i;
-        sprintf(ots[i].name, "table%zu", i);
+        sprintf(ots[i].name, "table%"PRI_ZU, i);
         ots[i].match = htonll(OFPXMT13_MASK);
         ots[i].wildcards = htonll(OFPXMT13_MASK);
         ots[i].write_actions = htonl(OFPAT11_OUTPUT);
diff --git a/ovsdb/execution.c b/ovsdb/execution.c
index 027e9e1..7ee35e3 100644
--- a/ovsdb/execution.c
+++ b/ovsdb/execution.c
@@ -140,7 +140,7 @@ ovsdb_execute(struct ovsdb *db, const struct ovsdb_session *session,
 
         /* Parse and execute operation. */
         ovsdb_parser_init(&parser, operation,
-                          "ovsdb operation %zu of %zu", i, n_operations);
+                          "ovsdb operation %"PRI_ZU" of %"PRI_ZU, i, n_operations);
         op = ovsdb_parser_member(&parser, "op", OP_ID);
         result = json_object_create();
         if (op) {
diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c
index 4cba4d9..91f88c4 100644
--- a/ovsdb/jsonrpc-server.c
+++ b/ovsdb/jsonrpc-server.c
@@ -482,8 +482,8 @@ ovsdb_jsonrpc_session_run(struct ovsdb_jsonrpc_session *s)
 
         monitor_length = ovsdb_jsonrpc_monitor_json_length_all(s);
         if (backlog > s->reply_backlog + monitor_length * 2) {
-            VLOG_INFO("%s: %zu bytes backlogged but a complete replica "
-                      "would only take %zu bytes, disconnecting",
+            VLOG_INFO("%s: %"PRI_ZU" bytes backlogged but a complete replica "
+                      "would only take %"PRI_ZU" bytes, disconnecting",
                       jsonrpc_session_get_name(s->js),
                       backlog - s->reply_backlog, monitor_length);
             jsonrpc_session_force_reconnect(s->js);
diff --git a/ovsdb/log.c b/ovsdb/log.c
index 1316025..cd23a25 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%"PRI_ZU" "SHA1_FMT"\n",
              magic, length, SHA1_ARGS(sha1));
 
     /* Write. */
diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
index 67d09cb..1063f7e 100644
--- a/ovsdb/ovsdb-client.c
+++ b/ovsdb/ovsdb-client.c
@@ -387,7 +387,7 @@ fetch_dbs(struct jsonrpc *rpc, struct svec *dbs)
         const struct json *name = reply->result->u.array.elems[i];
 
         if (name->type != JSON_STRING) {
-            ovs_fatal(0, "list_dbs response %zu is not string", i);
+            ovs_fatal(0, "list_dbs response %"PRI_ZU" is not string", i);
         }
         svec_add(dbs, name->u.string);
     }
@@ -847,7 +847,7 @@ dump_table(const struct ovsdb_table_schema *ts, struct json_array *rows)
         struct shash *row;
 
         if (rows->elems[y]->type != JSON_OBJECT) {
-            ovs_fatal(0,  "row %zu in table %s response is not a JSON object: "
+            ovs_fatal(0,  "row %"PRI_ZU" in table %s response is not a JSON object: "
                       "%s", y, ts->name, json_to_string(rows->elems[y], 0));
         }
         row = json_object(rows->elems[y]);
@@ -856,7 +856,7 @@ dump_table(const struct ovsdb_table_schema *ts, struct json_array *rows)
         for (x = 0; x < n_columns; x++) {
             const struct json *json = shash_find_data(row, columns[x]->name);
             if (!json) {
-                ovs_fatal(0, "row %zu in table %s response lacks %s column",
+                ovs_fatal(0, "row %"PRI_ZU" in table %s response lacks %s column",
                           y, ts->name, columns[x]->name);
             }
 
@@ -945,7 +945,7 @@ do_dump(struct jsonrpc *rpc, const char *database,
     /* Print database contents. */
     if (reply->result->type != JSON_ARRAY
         || reply->result->u.array.n != n_tables) {
-        ovs_fatal(0, "reply is not array of %zu elements: %s",
+        ovs_fatal(0, "reply is not array of %"PRI_ZU" elements: %s",
                   n_tables, json_to_string(reply->result, 0));
     }
     for (i = 0; i < n_tables; i++) {
diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c
index 646163a..5264c6e 100644
--- a/ovsdb/transaction.c
+++ b/ovsdb/transaction.c
@@ -295,7 +295,7 @@ check_ref_count(struct ovsdb_txn *txn OVS_UNUSED, struct ovsdb_txn_row *r)
     } else {
         return ovsdb_error("referential integrity violation",
                            "cannot delete %s row "UUID_FMT" because "
-                           "of %zu remaining reference(s)",
+                           "of %"PRI_ZU" remaining reference(s)",
                            r->table->schema->name, UUID_ARGS(&r->uuid),
                            r->n_refs);
     }
@@ -614,7 +614,7 @@ check_max_rows(struct ovsdb_txn *txn)
         if (n_rows > max_rows) {
             return ovsdb_error("constraint violation",
                                "transaction causes \"%s\" table to contain "
-                               "%zu rows, greater than the schema-defined "
+                               "%"PRI_ZU" rows, greater than the schema-defined "
                                "limit of %u row(s)",
                                t->table->schema->name, n_rows, max_rows);
         }
diff --git a/tests/test-aes128.c b/tests/test-aes128.c
index 19874b1..487352c 100644
--- a/tests/test-aes128.c
+++ b/tests/test-aes128.c
@@ -38,7 +38,7 @@ hex_to_uint8(const char *input, uint8_t *output, size_t n)
     return;
 
 error:
-    ovs_fatal(0, "\"%s\" is not exactly %zu hex digits", input, n * 2);
+    ovs_fatal(0, "\"%s\" is not exactly %"PRI_ZU" hex digits", input, n * 2);
 }
 
 int
diff --git a/tests/test-hindex.c b/tests/test-hindex.c
index f0a8b93..ba92687 100644
--- a/tests/test-hindex.c
+++ b/tests/test-hindex.c
@@ -137,7 +137,7 @@ print_hindex(const char *name, struct hindex *hindex)
 
     printf("%s:", name);
     HINDEX_FOR_EACH (e, node, hindex) {
-        printf(" %d(%zu)", e->value, e->node.hash & hindex->mask);
+        printf(" %d(%"PRI_ZU")", e->value, e->node.hash & hindex->mask);
     }
     printf("\n");
 }
diff --git a/tests/test-hmap.c b/tests/test-hmap.c
index 6102be3..757f60f 100644
--- a/tests/test-hmap.c
+++ b/tests/test-hmap.c
@@ -125,7 +125,7 @@ print_hmap(const char *name, struct hmap *hmap)
 
     printf("%s:", name);
     HMAP_FOR_EACH (e, node, hmap) {
-        printf(" %d(%zu)", e->value, e->node.hash & hmap->mask);
+        printf(" %d(%"PRI_ZU")", e->value, e->node.hash & hmap->mask);
     }
     printf("\n");
 }
diff --git a/tests/test-netflow.c b/tests/test-netflow.c
index e995852..51ad2c9 100644
--- a/tests/test-netflow.c
+++ b/tests/test-netflow.c
@@ -162,7 +162,7 @@ print_netflow(struct ofpbuf *buf)
     }
 
     if (buf->size) {
-        printf("%zu extra bytes after last record\n", buf->size);
+        printf("%"PRI_ZU" extra bytes after last record\n", buf->size);
     }
 }
 
diff --git a/tests/test-odp.c b/tests/test-odp.c
index 471851b..dfc81d4 100644
--- a/tests/test-odp.c
+++ b/tests/test-odp.c
@@ -78,7 +78,7 @@ parse_keys(bool wc_keys)
             odp_flow_key_from_flow(&odp_key, &flow, flow.in_port.odp_port);
 
             if (odp_key.size > ODPUTIL_FLOW_KEY_BYTES) {
-                printf ("too long: %zu > %d\n",
+                printf ("too long: %"PRI_ZU" > %d\n",
                         odp_key.size, ODPUTIL_FLOW_KEY_BYTES);
                 exit_code = 1;
             }
diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c
index 10d434e..0c036e7 100644
--- a/tests/test-ovsdb.c
+++ b/tests/test-ovsdb.c
@@ -945,7 +945,7 @@ do_execute_mutations(int argc OVS_UNUSED, char *argv[])
             row = ovsdb_row_clone(rows[j]);
             error = ovsdb_mutation_set_execute(row, &sets[i]);
 
-            printf("row %zu: ", j);
+            printf("row %"PRI_ZU": ", j);
             if (error) {
                 print_and_free_ovsdb_error(error);
             } else {
@@ -1680,7 +1680,7 @@ parse_uuids(const struct json *json, struct ovsdb_symbol_table *symtab,
     struct uuid uuid;
 
     if (json->type == JSON_STRING && uuid_from_string(&uuid, json->u.string)) {
-        char *name = xasprintf("#%zu#", *n);
+        char *name = xasprintf("#%"PRI_ZU"#", *n);
         fprintf(stderr, "%s = "UUID_FMT"\n", name, UUID_ARGS(&uuid));
         ovsdb_symbol_table_put(symtab, name, &uuid, false);
         free(name);
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 1d1b47f..59fde95 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -1805,7 +1805,7 @@ ofctl_ofp_parse(int argc OVS_UNUSED, char *argv[])
 
         length = ntohs(oh->length);
         if (length < sizeof *oh) {
-            ovs_fatal(0, "%s: %zu-byte message is too short for OpenFlow",
+            ovs_fatal(0, "%s: %"PRI_ZU"-byte message is too short for OpenFlow",
                       filename, length);
         }
 
@@ -1835,7 +1835,7 @@ ofctl_ping(int argc, char *argv[])
 
     payload = argc > 2 ? atoi(argv[2]) : 64;
     if (payload > max_payload) {
-        ovs_fatal(0, "payload must be between 0 and %zu bytes", max_payload);
+        ovs_fatal(0, "payload must be between 0 and %"PRI_ZU" bytes", max_payload);
     }
 
     open_vconn(argv[1], &vconn);
@@ -1863,7 +1863,7 @@ ofctl_ping(int argc, char *argv[])
             printf("Reply:\n");
             ofp_print(stdout, reply, reply->size, verbosity + 2);
         }
-        printf("%zu bytes from %s: xid=%08"PRIx32" time=%.1f ms\n",
+        printf("%"PRI_ZU" bytes from %s: xid=%08"PRIx32" time=%.1f ms\n",
                reply->size, argv[1], ntohl(rpy_hdr->xid),
                    (1000*(double)(end.tv_sec - start.tv_sec))
                    + (.001*(end.tv_usec - start.tv_usec)));
@@ -1886,7 +1886,7 @@ ofctl_benchmark(int argc OVS_UNUSED, char *argv[])
 
     payload_size = atoi(argv[2]);
     if (payload_size > max_payload) {
-        ovs_fatal(0, "payload must be between 0 and %zu bytes", max_payload);
+        ovs_fatal(0, "payload must be between 0 and %"PRI_ZU" bytes", max_payload);
     }
     message_size = sizeof(struct ofp_header) + payload_size;
 
@@ -2875,7 +2875,7 @@ ofctl_parse_ofp10_match(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
             ovs_fatal(0, "Trailing garbage in hex data");
         }
         if (match_expout.size != sizeof(struct ofp10_match)) {
-            ovs_fatal(0, "Input is %zu bytes, expected %zu",
+            ovs_fatal(0, "Input is %"PRI_ZU" bytes, expected %"PRI_ZU,
                       match_expout.size, sizeof(struct ofp10_match));
         }
 
@@ -2890,7 +2890,7 @@ ofctl_parse_ofp10_match(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
             ovs_fatal(0, "Trailing garbage in hex data");
         }
         if (match_in.size != sizeof(struct ofp10_match)) {
-            ovs_fatal(0, "Input is %zu bytes, expected %zu",
+            ovs_fatal(0, "Input is %"PRI_ZU" bytes, expected %"PRI_ZU,
                       match_in.size, sizeof(struct ofp10_match));
         }
 
@@ -2939,7 +2939,7 @@ ofctl_parse_ofp11_match(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
             ovs_fatal(0, "Trailing garbage in hex data");
         }
         if (match_in.size != sizeof(struct ofp11_match)) {
-            ovs_fatal(0, "Input is %zu bytes, expected %zu",
+            ovs_fatal(0, "Input is %"PRI_ZU" bytes, expected %"PRI_ZU,
                       match_in.size, sizeof(struct ofp11_match));
         }



More information about the dev mailing list