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:
@@ -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 %"PRIuSIZE" or %"PRIu32" "
|
||||
"reading pcap file",
|
||||
len, swapped_len);
|
||||
return EPROTO;
|
||||
|
Reference in New Issue
Block a user