MSVC 2013 finally implements them, 14 years after they became part of C,
so we can use them in generic code now.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
This allows other libraries to use util.h that has already
defined NOT_REACHED.
Signed-off-by: Harold Lim <haroldl@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
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 adds guide about using thread safety types and annotations
to CodingStyle file.
Signed-off-by: Alex Wang <alexw@nicira.com>
[blp@nicira.com edited the advice slightly]
Signed-off-by: Ben Pfaff <blp@nicira.com>
Clang has nice static analysis and works well as an Open vSwitch compiler,
so mention it more explicitly.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
I like the style that was prescribed here--I find it slightly easier to
read--but everyone else who submits code seems to prefer breaking
lines after binary operators instead. No point in fighting the tide.
To make the netdev code more portable, it needs to support returning error
codes from functions that don't have them. This commit changes
netdev_get_mtu() to return an error code and updates its caller.
(Currently netdev_get_mtu() won't ever return an error, but other future
implementations might.)