mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
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 <inttypes.h> 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 <aserdean@cloudbasesolutions.com> Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -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 %"PRIuSIZE" 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 (%"PRIuSIZE"d bytes < %"PRIuSIZE")",
|
||||
retval, sizeof *nlmsghdr);
|
||||
return EPROTO;
|
||||
}
|
||||
|
Reference in New Issue
Block a user