[ovs-dev] [PATCH 01/10] lib: Move compiler.h to <openvswitch/compiler.h>

Thomas Graf tgraf at noironetworks.com
Tue Dec 9 18:28:52 UTC 2014


The following macros are renamed to avoid conflicts with other headers:
 * WARN_UNUSED_RESULT to OVS_WARN_UNUSED_RESULT
 * PRINTF_FORMAT to OVS_PRINTF_FORMAT
 * NO_RETURN to OVS_NO_RETURN

Signed-off-by: Thomas Graf <tgraf at noironetworks.com>
---
 include/openvswitch/automake.mk |   1 +
 include/openvswitch/compiler.h  | 224 ++++++++++++++++++++++++++++++++++++++++
 lib/bundle.c                    |   6 +-
 lib/bundle.h                    |   4 +-
 lib/command-line.h              |   2 +-
 lib/compiler.h                  | 200 +----------------------------------
 lib/dynamic-string.h            |   4 +-
 lib/json.c                      |   2 +-
 lib/learn.c                     |   8 +-
 lib/learn.h                     |   2 +-
 lib/multipath.c                 |   4 +-
 lib/multipath.h                 |   2 +-
 lib/nx-match.c                  |   8 +-
 lib/nx-match.h                  |   8 +-
 lib/ofp-actions.c               | 118 ++++++++++-----------
 lib/ofp-actions.h               |   4 +-
 lib/ofp-parse.c                 |  44 ++++----
 lib/ofp-parse.h                 |  32 +++---
 lib/ofp-print.c                 |   2 +-
 lib/ofp-util.c                  |   2 +-
 lib/ovsdb-data.c                |   4 +-
 lib/ovsdb-data.h                |  16 +--
 lib/ovsdb-error.h               |  20 ++--
 lib/ovsdb-idl.h                 |   2 +-
 lib/ovsdb-parser.h              |   6 +-
 lib/ovsdb-types.h               |   4 +-
 lib/smap.h                      |   2 +-
 lib/stream-nossl.c              |   2 +-
 lib/table.h                     |   2 +-
 lib/unicode.h                   |   2 +-
 lib/util.h                      |  32 +++---
 lib/vlog.c                      |   2 +-
 lib/vlog.h                      |  24 ++---
 ofproto/ofproto-dpif.c          |   2 +-
 ovsdb/column.h                  |   2 +-
 ovsdb/condition.c               |   2 +-
 ovsdb/condition.h               |   4 +-
 ovsdb/execution.c               |   2 +-
 ovsdb/file.h                    |   8 +-
 ovsdb/jsonrpc-server.c          |   2 +-
 ovsdb/log.h                     |   8 +-
 ovsdb/mutation.c                |   4 +-
 ovsdb/mutation.h                |   6 +-
 ovsdb/ovsdb-client.c            |   2 +-
 ovsdb/ovsdb-server.c            |   8 +-
 ovsdb/ovsdb-tool.c              |   2 +-
 ovsdb/ovsdb.c                   |   2 +-
 ovsdb/ovsdb.h                   |   4 +-
 ovsdb/row.h                     |   2 +-
 ovsdb/table.h                   |   2 +-
 ovsdb/transaction.c             |  32 +++---
 ovsdb/transaction.h             |   2 +-
 tests/test-jsonrpc.c            |   2 +-
 tests/test-netflow.c            |   2 +-
 tests/test-ovsdb.c              |   2 +-
 tests/test-rstp.c               |   6 +-
 tests/test-sflow.c              |   2 +-
 tests/test-stp.c                |   6 +-
 utilities/ovs-dpctl.c           |   2 +-
 utilities/ovs-ofctl.c           |   4 +-
 utilities/ovs-testcontroller.c  |   2 +-
 utilities/ovs-vsctl.c           |   8 +-
 vswitchd/ovs-vswitchd.c         |   2 +-
 vswitchd/system-stats.c         |   2 +-
 vtep/vtep-ctl.c                 |   8 +-
 65 files changed, 483 insertions(+), 456 deletions(-)
 create mode 100644 include/openvswitch/compiler.h

diff --git a/include/openvswitch/automake.mk b/include/openvswitch/automake.mk
index cf89f44..b35bfce 100644
--- a/include/openvswitch/automake.mk
+++ b/include/openvswitch/automake.mk
@@ -1,5 +1,6 @@
 openvswitchincludedir = $(includedir)/openvswitch
 openvswitchinclude_HEADERS = \
+	include/openvswitch/compiler.h \
 	include/openvswitch/types.h \
 	include/openvswitch/util.h \
 	include/openvswitch/version.h
diff --git a/include/openvswitch/compiler.h b/include/openvswitch/compiler.h
new file mode 100644
index 0000000..382b668
--- /dev/null
+++ b/include/openvswitch/compiler.h
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OPENVSWITCH_COMPILER_H
+#define OPENVSWITCH_COMPILER_H 1
+
+#ifndef __has_feature
+  #define __has_feature(x) 0
+#endif
+#ifndef __has_extension
+  #define __has_extension(x) 0
+#endif
+
+/* To make OVS_NO_RETURN portable across gcc/clang and MSVC, it should be
+ * added at the beginning of the function declaration. */
+#if __GNUC__ && !__CHECKER__
+#define OVS_NO_RETURN __attribute__((__noreturn__))
+#elif _MSC_VER
+#define OVS_NO_RETURN __declspec(noreturn)
+#else
+#define OVS_NO_RETURN
+#endif
+
+#if __GNUC__ && !__CHECKER__
+#define OVS_UNUSED __attribute__((__unused__))
+#define OVS_PRINTF_FORMAT(FMT, ARG1) __attribute__((__format__(printf, FMT, ARG1)))
+#define OVS_SCANF_FORMAT(FMT, ARG1) __attribute__((__format__(scanf, FMT, ARG1)))
+#define OVS_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
+#define OVS_LIKELY(CONDITION) __builtin_expect(!!(CONDITION), 1)
+#define OVS_UNLIKELY(CONDITION) __builtin_expect(!!(CONDITION), 0)
+#else
+#define OVS_UNUSED
+#define OVS_PRINTF_FORMAT(FMT, ARG1)
+#define OVS_SCANF_FORMAT(FMT, ARG1)
+#define OVS_WARN_UNUSED_RESULT
+#define OVS_LIKELY(CONDITION) (!!(CONDITION))
+#define OVS_UNLIKELY(CONDITION) (!!(CONDITION))
+#endif
+
+#if __has_feature(c_thread_safety_attributes)
+/* "clang" annotations for thread safety check.
+ *
+ * OVS_LOCKABLE indicates that the struct contains mutex element
+ * which can be locked by functions like ovs_mutex_lock().
+ *
+ * Below, the word MUTEX stands for the name of an object with an OVS_LOCKABLE
+ * struct type.  It can also be a comma-separated list of multiple structs,
+ * e.g. to require a function to hold multiple locks while invoked.
+ *
+ *
+ * On a variable:
+ *
+ *    - OVS_GUARDED indicates that the variable may only be accessed some mutex
+ *      is held.
+ *
+ *    - OVS_GUARDED_BY(MUTEX) indicates that the variable may only be accessed
+ *      while the specific MUTEX is held.
+ *
+ *
+ * On a variable A of mutex type:
+ *
+ *    - OVS_ACQ_BEFORE(B), where B is a mutex or a comma-separated list of
+ *      mutexes, declare that if both A and B are acquired at the same time,
+ *      then A must be acquired before B.  That is, B nests inside A.
+ *
+ *    - OVS_ACQ_AFTER(B) is the opposite of OVS_ACQ_BEFORE(B), that is, it
+ *      declares that A nests inside B.
+ *
+ *
+ * On a function, the following attributes apply to mutexes:
+ *
+ *    - OVS_ACQUIRES(MUTEX) indicate that the function must be called without
+ *      holding MUTEX and that it returns holding MUTEX.
+ *
+ *    - OVS_RELEASES(MUTEX) indicates that the function may only be called with
+ *      MUTEX held and that it returns with MUTEX released.  It can be used for
+ *      all types of MUTEX.
+ *
+ *    - OVS_TRY_LOCK(RETVAL, MUTEX) indicate that the function will try to
+ *      acquire MUTEX.  RETVAL is an integer or boolean value specifying the
+ *      return value of a successful lock acquisition.
+ *
+ *    - OVS_REQUIRES(MUTEX) indicate that the function may only be called with
+ *      MUTEX held and that the function does not release MUTEX.
+ *
+ *    - OVS_EXCLUDED(MUTEX) indicates that the function may only be called when
+ *      MUTEX is not held.
+ *
+ *
+ * The following variants, with the same syntax, apply to reader-writer locks:
+ *
+ *    mutex                rwlock, for reading  rwlock, for writing
+ *    -------------------  -------------------  -------------------
+ *    OVS_ACQUIRES         OVS_ACQ_RDLOCK       OVS_ACQ_WRLOCK
+ *    OVS_RELEASES         OVS_RELEASES         OVS_RELEASES
+ *    OVS_TRY_LOCK         OVS_TRY_RDLOCK       OVS_TRY_WRLOCK
+ *    OVS_REQUIRES         OVS_REQ_RDLOCK       OVS_REQ_WRLOCK
+ *    OVS_EXCLUDED         OVS_EXCLUDED         OVS_EXCLUDED
+ */
+#define OVS_LOCKABLE __attribute__((lockable))
+#define OVS_REQ_RDLOCK(...) __attribute__((shared_locks_required(__VA_ARGS__)))
+#define OVS_ACQ_RDLOCK(...) __attribute__((shared_lock_function(__VA_ARGS__)))
+#define OVS_REQ_WRLOCK(...) \
+    __attribute__((exclusive_locks_required(__VA_ARGS__)))
+#define OVS_ACQ_WRLOCK(...) \
+    __attribute__((exclusive_lock_function(__VA_ARGS__)))
+#define OVS_REQUIRES(...) \
+    __attribute__((exclusive_locks_required(__VA_ARGS__)))
+#define OVS_ACQUIRES(...) \
+    __attribute__((exclusive_lock_function(__VA_ARGS__)))
+#define OVS_TRY_WRLOCK(RETVAL, ...)                              \
+    __attribute__((exclusive_trylock_function(RETVAL, __VA_ARGS__)))
+#define OVS_TRY_RDLOCK(RETVAL, ...)                          \
+    __attribute__((shared_trylock_function(RETVAL, __VA_ARGS__)))
+#define OVS_TRY_LOCK(RETVAL, ...)                                \
+    __attribute__((exclusive_trylock_function(RETVAL, __VA_ARGS__)))
+#define OVS_GUARDED __attribute__((guarded_var))
+#define OVS_GUARDED_BY(...) __attribute__((guarded_by(__VA_ARGS__)))
+#define OVS_RELEASES(...) __attribute__((unlock_function(__VA_ARGS__)))
+#define OVS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))
+#define OVS_ACQ_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__)))
+#define OVS_ACQ_AFTER(...) __attribute__((acquired_after(__VA_ARGS__)))
+#define OVS_NO_THREAD_SAFETY_ANALYSIS \
+    __attribute__((no_thread_safety_analysis))
+#else  /* not Clang */
+#define OVS_LOCKABLE
+#define OVS_REQ_RDLOCK(...)
+#define OVS_ACQ_RDLOCK(...)
+#define OVS_REQ_WRLOCK(...)
+#define OVS_ACQ_WRLOCK(...)
+#define OVS_REQUIRES(...)
+#define OVS_ACQUIRES(...)
+#define OVS_TRY_WRLOCK(...)
+#define OVS_TRY_RDLOCK(...)
+#define OVS_TRY_LOCK(...)
+#define OVS_GUARDED
+#define OVS_GUARDED_BY(...)
+#define OVS_EXCLUDED(...)
+#define OVS_RELEASES(...)
+#define OVS_ACQ_BEFORE(...)
+#define OVS_ACQ_AFTER(...)
+#define OVS_NO_THREAD_SAFETY_ANALYSIS
+#endif
+
+/* ISO C says that a C implementation may choose any integer type for an enum
+ * that is sufficient to hold all of its values.  Common ABIs (such as the
+ * System V ABI used on i386 GNU/Linux) always use a full-sized "int", even
+ * when a smaller type would suffice.
+ *
+ * In GNU C, "enum __attribute__((packed)) name { ... }" defines 'name' as an
+ * enum compatible with a type that is no bigger than necessary.  This is the
+ * intended use of OVS_PACKED_ENUM.
+ *
+ * OVS_PACKED_ENUM is intended for use only as a space optimization, since it
+ * only works with GCC.  That means that it must not be used in wire protocols
+ * or otherwise exposed outside of a single process. */
+#if __GNUC__ && !__CHECKER__
+#define OVS_PACKED_ENUM __attribute__((__packed__))
+#define HAVE_PACKED_ENUM
+#else
+#define OVS_PACKED_ENUM
+#endif
+
+#ifndef _MSC_VER
+#define OVS_PACKED(DECL) DECL __attribute__((__packed__))
+#else
+#define OVS_PACKED(DECL) __pragma(pack(push, 1)) DECL __pragma(pack(pop))
+#endif
+
+/* For defining a structure whose instances should aligned on an N-byte
+ * boundary.
+ *
+ * e.g. The following:
+ *     OVS_ALIGNED_STRUCT(64, mystruct) { ... };
+ * is equivalent to the following except that it specifies 64-byte alignment:
+ *     struct mystruct { ... };
+ */
+#ifndef _MSC_VER
+#define OVS_ALIGNED_STRUCT(N, TAG) struct __attribute__((aligned(N))) TAG
+#else
+#define OVS_ALIGNED_STRUCT(N, TAG) __declspec(align(N)) struct TAG
+#endif
+
+#ifdef _MSC_VER
+#define CCALL __cdecl
+#pragma section(".CRT$XCU",read)
+#define OVS_CONSTRUCTOR(f) \
+    static void __cdecl f(void); \
+    __declspec(allocate(".CRT$XCU")) void (__cdecl*f##_)(void) = f; \
+    static void __cdecl f(void)
+#else
+#define OVS_CONSTRUCTOR(f) \
+    static void f(void) __attribute__((constructor)); \
+    static void f(void)
+#endif
+
+/* OVS_PREFETCH() can be used to instruct the CPU to fetch the cache
+ * line containing the given address to a CPU cache.
+ * OVS_PREFETCH_WRITE() should be used when the memory is going to be
+ * written to.  Depending on the target CPU, this can generate the same
+ * instruction as OVS_PREFETCH(), or bring the data into the cache in an
+ * exclusive state. */
+#if __GNUC__
+#define OVS_PREFETCH(addr) __builtin_prefetch((addr))
+#define OVS_PREFETCH_WRITE(addr) __builtin_prefetch((addr), 1)
+#else
+#define OVS_PREFETCH(addr)
+#define OVS_PREFETCH_WRITE(addr)
+#endif
+
+#endif /* compiler.h */
diff --git a/lib/bundle.c b/lib/bundle.c
index 793eb82..700969b 100644
--- a/lib/bundle.c
+++ b/lib/bundle.c
@@ -142,7 +142,7 @@ bundle_check(const struct ofpact_bundle *bundle, ofp_port_t max_ports,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string.*/
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 bundle_parse__(const char *s, char **save_ptr,
                const char *fields, const char *basis, const char *algorithm,
                const char *slave_type, const char *dst,
@@ -222,7 +222,7 @@ bundle_parse__(const char *s, char **save_ptr,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 bundle_parse(const char *s, struct ofpbuf *ofpacts)
 {
     char *fields, *basis, *algorithm, *slave_type, *slave_delim;
@@ -249,7 +249,7 @@ bundle_parse(const char *s, struct ofpbuf *ofpacts)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string.*/
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 bundle_parse_load(const char *s, struct ofpbuf *ofpacts)
 {
     char *fields, *basis, *algorithm, *slave_type, *dst, *slave_delim;
diff --git a/lib/bundle.h b/lib/bundle.h
index c2a22f0..a1f0ef2 100644
--- a/lib/bundle.h
+++ b/lib/bundle.h
@@ -44,9 +44,9 @@ ofp_port_t bundle_execute(const struct ofpact_bundle *, const struct flow *,
                         void *aux);
 enum ofperr bundle_check(const struct ofpact_bundle *, ofp_port_t max_ports,
                          const struct flow *);
-char *bundle_parse(const char *, struct ofpbuf *ofpacts) WARN_UNUSED_RESULT;
+char *bundle_parse(const char *, struct ofpbuf *ofpacts) OVS_WARN_UNUSED_RESULT;
 char *bundle_parse_load(const char *, struct ofpbuf *ofpacts)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 void bundle_format(const struct ofpact_bundle *, struct ds *);
 
 #endif /* bundle.h */
diff --git a/lib/command-line.h b/lib/command-line.h
index 0c9e2d9..7e68504 100644
--- a/lib/command-line.h
+++ b/lib/command-line.h
@@ -41,7 +41,7 @@ void proctitle_init(int argc, char **argv);
 #define proctitle_set setproctitle
 #else
 void proctitle_set(const char *, ...)
-    PRINTF_FORMAT(1, 2);
+    OVS_PRINTF_FORMAT(1, 2);
 #endif
 void proctitle_restore(void);
 
diff --git a/lib/compiler.h b/lib/compiler.h
index 629d09b..9e44d46 100644
--- a/lib/compiler.h
+++ b/lib/compiler.h
@@ -17,216 +17,18 @@
 #ifndef COMPILER_H
 #define COMPILER_H 1
 
-#ifndef __has_feature
-  #define __has_feature(x) 0
-#endif
-#ifndef __has_extension
-  #define __has_extension(x) 0
-#endif
+#include "openvswitch/compiler.h"
 
-/* To make NO_RETURN portable across gcc/clang and MSVC, it should be
- * added at the beginning of the function declaration. */
 #if __GNUC__ && !__CHECKER__
-#define NO_RETURN __attribute__((__noreturn__))
-#elif _MSC_VER
-#define NO_RETURN __declspec(noreturn)
-#else
-#define NO_RETURN
-#endif
-
-#if __GNUC__ && !__CHECKER__
-#define OVS_UNUSED __attribute__((__unused__))
-#define PRINTF_FORMAT(FMT, ARG1) __attribute__((__format__(printf, FMT, ARG1)))
-#define SCANF_FORMAT(FMT, ARG1) __attribute__((__format__(scanf, FMT, ARG1)))
 #define STRFTIME_FORMAT(FMT) __attribute__((__format__(__strftime__, FMT, 0)))
 #define MALLOC_LIKE __attribute__((__malloc__))
 #define ALWAYS_INLINE __attribute__((always_inline))
-#define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
 #define SENTINEL(N) __attribute__((sentinel(N)))
-#define OVS_LIKELY(CONDITION) __builtin_expect(!!(CONDITION), 1)
-#define OVS_UNLIKELY(CONDITION) __builtin_expect(!!(CONDITION), 0)
 #else
-#define OVS_UNUSED
-#define PRINTF_FORMAT(FMT, ARG1)
-#define SCANF_FORMAT(FMT, ARG1)
 #define STRFTIME_FORMAT(FMT)
 #define MALLOC_LIKE
 #define ALWAYS_INLINE
-#define WARN_UNUSED_RESULT
 #define SENTINEL(N)
-#define OVS_LIKELY(CONDITION) (!!(CONDITION))
-#define OVS_UNLIKELY(CONDITION) (!!(CONDITION))
-#endif
-
-#if __has_feature(c_thread_safety_attributes)
-/* "clang" annotations for thread safety check.
- *
- * OVS_LOCKABLE indicates that the struct contains mutex element
- * which can be locked by functions like ovs_mutex_lock().
- *
- * Below, the word MUTEX stands for the name of an object with an OVS_LOCKABLE
- * struct type.  It can also be a comma-separated list of multiple structs,
- * e.g. to require a function to hold multiple locks while invoked.
- *
- *
- * On a variable:
- *
- *    - OVS_GUARDED indicates that the variable may only be accessed some mutex
- *      is held.
- *
- *    - OVS_GUARDED_BY(MUTEX) indicates that the variable may only be accessed
- *      while the specific MUTEX is held.
- *
- *
- * On a variable A of mutex type:
- *
- *    - OVS_ACQ_BEFORE(B), where B is a mutex or a comma-separated list of
- *      mutexes, declare that if both A and B are acquired at the same time,
- *      then A must be acquired before B.  That is, B nests inside A.
- *
- *    - OVS_ACQ_AFTER(B) is the opposite of OVS_ACQ_BEFORE(B), that is, it
- *      declares that A nests inside B.
- *
- *
- * On a function, the following attributes apply to mutexes:
- *
- *    - OVS_ACQUIRES(MUTEX) indicate that the function must be called without
- *      holding MUTEX and that it returns holding MUTEX.
- *
- *    - OVS_RELEASES(MUTEX) indicates that the function may only be called with
- *      MUTEX held and that it returns with MUTEX released.  It can be used for
- *      all types of MUTEX.
- *
- *    - OVS_TRY_LOCK(RETVAL, MUTEX) indicate that the function will try to
- *      acquire MUTEX.  RETVAL is an integer or boolean value specifying the
- *      return value of a successful lock acquisition.
- *
- *    - OVS_REQUIRES(MUTEX) indicate that the function may only be called with
- *      MUTEX held and that the function does not release MUTEX.
- *
- *    - OVS_EXCLUDED(MUTEX) indicates that the function may only be called when
- *      MUTEX is not held.
- *
- *
- * The following variants, with the same syntax, apply to reader-writer locks:
- *
- *    mutex                rwlock, for reading  rwlock, for writing
- *    -------------------  -------------------  -------------------
- *    OVS_ACQUIRES         OVS_ACQ_RDLOCK       OVS_ACQ_WRLOCK
- *    OVS_RELEASES         OVS_RELEASES         OVS_RELEASES
- *    OVS_TRY_LOCK         OVS_TRY_RDLOCK       OVS_TRY_WRLOCK
- *    OVS_REQUIRES         OVS_REQ_RDLOCK       OVS_REQ_WRLOCK
- *    OVS_EXCLUDED         OVS_EXCLUDED         OVS_EXCLUDED
- */
-#define OVS_LOCKABLE __attribute__((lockable))
-#define OVS_REQ_RDLOCK(...) __attribute__((shared_locks_required(__VA_ARGS__)))
-#define OVS_ACQ_RDLOCK(...) __attribute__((shared_lock_function(__VA_ARGS__)))
-#define OVS_REQ_WRLOCK(...) \
-    __attribute__((exclusive_locks_required(__VA_ARGS__)))
-#define OVS_ACQ_WRLOCK(...) \
-    __attribute__((exclusive_lock_function(__VA_ARGS__)))
-#define OVS_REQUIRES(...) \
-    __attribute__((exclusive_locks_required(__VA_ARGS__)))
-#define OVS_ACQUIRES(...) \
-    __attribute__((exclusive_lock_function(__VA_ARGS__)))
-#define OVS_TRY_WRLOCK(RETVAL, ...)                              \
-    __attribute__((exclusive_trylock_function(RETVAL, __VA_ARGS__)))
-#define OVS_TRY_RDLOCK(RETVAL, ...)                          \
-    __attribute__((shared_trylock_function(RETVAL, __VA_ARGS__)))
-#define OVS_TRY_LOCK(RETVAL, ...)                                \
-    __attribute__((exclusive_trylock_function(RETVAL, __VA_ARGS__)))
-#define OVS_GUARDED __attribute__((guarded_var))
-#define OVS_GUARDED_BY(...) __attribute__((guarded_by(__VA_ARGS__)))
-#define OVS_RELEASES(...) __attribute__((unlock_function(__VA_ARGS__)))
-#define OVS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))
-#define OVS_ACQ_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__)))
-#define OVS_ACQ_AFTER(...) __attribute__((acquired_after(__VA_ARGS__)))
-#define OVS_NO_THREAD_SAFETY_ANALYSIS \
-    __attribute__((no_thread_safety_analysis))
-#else  /* not Clang */
-#define OVS_LOCKABLE
-#define OVS_REQ_RDLOCK(...)
-#define OVS_ACQ_RDLOCK(...)
-#define OVS_REQ_WRLOCK(...)
-#define OVS_ACQ_WRLOCK(...)
-#define OVS_REQUIRES(...)
-#define OVS_ACQUIRES(...)
-#define OVS_TRY_WRLOCK(...)
-#define OVS_TRY_RDLOCK(...)
-#define OVS_TRY_LOCK(...)
-#define OVS_GUARDED
-#define OVS_GUARDED_BY(...)
-#define OVS_EXCLUDED(...)
-#define OVS_RELEASES(...)
-#define OVS_ACQ_BEFORE(...)
-#define OVS_ACQ_AFTER(...)
-#define OVS_NO_THREAD_SAFETY_ANALYSIS
-#endif
-
-/* ISO C says that a C implementation may choose any integer type for an enum
- * that is sufficient to hold all of its values.  Common ABIs (such as the
- * System V ABI used on i386 GNU/Linux) always use a full-sized "int", even
- * when a smaller type would suffice.
- *
- * In GNU C, "enum __attribute__((packed)) name { ... }" defines 'name' as an
- * enum compatible with a type that is no bigger than necessary.  This is the
- * intended use of OVS_PACKED_ENUM.
- *
- * OVS_PACKED_ENUM is intended for use only as a space optimization, since it
- * only works with GCC.  That means that it must not be used in wire protocols
- * or otherwise exposed outside of a single process. */
-#if __GNUC__ && !__CHECKER__
-#define OVS_PACKED_ENUM __attribute__((__packed__))
-#define HAVE_PACKED_ENUM
-#else
-#define OVS_PACKED_ENUM
-#endif
-
-#ifndef _MSC_VER
-#define OVS_PACKED(DECL) DECL __attribute__((__packed__))
-#else
-#define OVS_PACKED(DECL) __pragma(pack(push, 1)) DECL __pragma(pack(pop))
-#endif
-
-/* For defining a structure whose instances should aligned on an N-byte
- * boundary.
- *
- * e.g. The following:
- *     OVS_ALIGNED_STRUCT(64, mystruct) { ... };
- * is equivalent to the following except that it specifies 64-byte alignment:
- *     struct mystruct { ... };
- */
-#ifndef _MSC_VER
-#define OVS_ALIGNED_STRUCT(N, TAG) struct __attribute__((aligned(N))) TAG
-#else
-#define OVS_ALIGNED_STRUCT(N, TAG) __declspec(align(N)) struct TAG
-#endif
-
-#ifdef _MSC_VER
-#define CCALL __cdecl
-#pragma section(".CRT$XCU",read)
-#define OVS_CONSTRUCTOR(f) \
-    static void __cdecl f(void); \
-    __declspec(allocate(".CRT$XCU")) void (__cdecl*f##_)(void) = f; \
-    static void __cdecl f(void)
-#else
-#define OVS_CONSTRUCTOR(f) \
-    static void f(void) __attribute__((constructor)); \
-    static void f(void)
-#endif
-
-/* OVS_PREFETCH() can be used to instruct the CPU to fetch the cache
- * line containing the given address to a CPU cache.
- * OVS_PREFETCH_WRITE() should be used when the memory is going to be
- * written to.  Depending on the target CPU, this can generate the same
- * instruction as OVS_PREFETCH(), or bring the data into the cache in an
- * exclusive state. */
-#if __GNUC__
-#define OVS_PREFETCH(addr) __builtin_prefetch((addr))
-#define OVS_PREFETCH_WRITE(addr) __builtin_prefetch((addr), 1)
-#else
-#define OVS_PREFETCH(addr)
-#define OVS_PREFETCH_WRITE(addr)
 #endif
 
 /* Output a message (not an error) while compiling without failing the
diff --git a/lib/dynamic-string.h b/lib/dynamic-string.h
index 396a24e..dc5981a 100644
--- a/lib/dynamic-string.h
+++ b/lib/dynamic-string.h
@@ -51,9 +51,9 @@ void ds_put_char_multiple(struct ds *, char, size_t n);
 void ds_put_buffer(struct ds *, const char *, size_t n);
 void ds_put_cstr(struct ds *, const char *);
 void ds_put_and_free_cstr(struct ds *, char *);
-void ds_put_format(struct ds *, const char *, ...) PRINTF_FORMAT(2, 3);
+void ds_put_format(struct ds *, const char *, ...) OVS_PRINTF_FORMAT(2, 3);
 void ds_put_format_valist(struct ds *, const char *, va_list)
-    PRINTF_FORMAT(2, 0);
+    OVS_PRINTF_FORMAT(2, 0);
 void ds_put_printable(struct ds *, const char *, size_t);
 void ds_put_hex_dump(struct ds *ds, const void *buf_, size_t size,
                      uintptr_t ofs, bool ascii);
diff --git a/lib/json.c b/lib/json.c
index 8114972..f004771 100644
--- a/lib/json.c
+++ b/lib/json.c
@@ -117,7 +117,7 @@ static struct json *json_create(enum json_type type);
 static void json_parser_input(struct json_parser *, struct json_token *);
 
 static void json_error(struct json_parser *p, const char *format, ...)
-    PRINTF_FORMAT(2, 3);
+    OVS_PRINTF_FORMAT(2, 3);
 
 const char *
 json_type_to_string(enum json_type type)
diff --git a/lib/learn.c b/lib/learn.c
index 8a17a0d..71c9780 100644
--- a/lib/learn.c
+++ b/lib/learn.c
@@ -186,7 +186,7 @@ learn_mask(const struct ofpact_learn *learn, struct flow_wildcards *wc)
 
 /* Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 learn_parse_load_immediate(const char *s, struct ofpact_learn_spec *spec)
 {
     const char *full_s = s;
@@ -245,7 +245,7 @@ learn_parse_load_immediate(const char *s, struct ofpact_learn_spec *spec)
 
 /* Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 learn_parse_spec(const char *orig, char *name, char *value,
                  struct ofpact_learn_spec *spec)
 {
@@ -338,7 +338,7 @@ learn_parse_spec(const char *orig, char *name, char *value,
 
 /* Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 learn_parse__(char *orig, char *arg, struct ofpbuf *ofpacts)
 {
     struct ofpact_learn *learn;
@@ -413,7 +413,7 @@ learn_parse__(char *orig, char *arg, struct ofpbuf *ofpacts)
  * the action's arguments.
  *
  * Modifies 'arg'. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 learn_parse(char *arg, struct ofpbuf *ofpacts)
 {
     char *orig = xstrdup(arg);
diff --git a/lib/learn.h b/lib/learn.h
index bedd2c7..1bc00ff 100644
--- a/lib/learn.h
+++ b/lib/learn.h
@@ -38,7 +38,7 @@ void learn_execute(const struct ofpact_learn *, const struct flow *,
                    struct ofputil_flow_mod *, struct ofpbuf *ofpacts);
 void learn_mask(const struct ofpact_learn *, struct flow_wildcards *);
 
-char *learn_parse(char *, struct ofpbuf *ofpacts) WARN_UNUSED_RESULT;
+char *learn_parse(char *, struct ofpbuf *ofpacts) OVS_WARN_UNUSED_RESULT;
 void learn_format(const struct ofpact_learn *, struct ds *);
 
 #endif /* learn.h */
diff --git a/lib/multipath.c b/lib/multipath.c
index edd295f..355ef4b 100644
--- a/lib/multipath.c
+++ b/lib/multipath.c
@@ -139,7 +139,7 @@ multipath_algorithm(uint32_t hash, enum nx_mp_algorithm algorithm,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string.*/
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s)
 {
     char *save_ptr = NULL;
@@ -207,7 +207,7 @@ multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 multipath_parse(struct ofpact_multipath *mp, const char *s_)
 {
     char *s = xstrdup(s_);
diff --git a/lib/multipath.h b/lib/multipath.h
index e1e2e2f..180681e 100644
--- a/lib/multipath.h
+++ b/lib/multipath.h
@@ -37,7 +37,7 @@ void multipath_execute(const struct ofpact_multipath *, struct flow *,
                        struct flow_wildcards *);
 
 char *multipath_parse(struct ofpact_multipath *, const char *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 void multipath_format(const struct ofpact_multipath *, struct ds *);
 
 #endif /* multipath.h */
diff --git a/lib/nx-match.c b/lib/nx-match.c
index bc6682d..9e9aeb4 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -1308,7 +1308,7 @@ oxm_match_from_string(const char *s, struct ofpbuf *b)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 nxm_parse_reg_move(struct ofpact_reg_move *move, const char *s)
 {
     const char *full_s = s;
@@ -1410,7 +1410,7 @@ nxm_reg_load(const struct mf_subfield *dst, uint64_t src_data,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 nxm_parse_stack_action(struct ofpact_stack *stack_action, const char *s)
 {
     char *error;
@@ -1560,7 +1560,7 @@ mf_parse_subfield_name(const char *name, int name_len, bool *wild)
  * bit indexes.  "..end" may be omitted to indicate a single bit.  "start..end"
  * may both be omitted (the [] are still required) to indicate an entire
  * field. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 mf_parse_subfield__(struct mf_subfield *sf, const char **sp)
 {
     const struct mf_field *field;
@@ -1626,7 +1626,7 @@ mf_parse_subfield__(struct mf_subfield *sf, const char **sp)
  * bit indexes.  "..end" may be omitted to indicate a single bit.  "start..end"
  * may both be omitted (the [] are still required) to indicate an entire
  * field.  */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 mf_parse_subfield(struct mf_subfield *sf, const char *s)
 {
     char *error = mf_parse_subfield__(sf, &s);
diff --git a/lib/nx-match.h b/lib/nx-match.h
index 62e73a0..9cb6461 100644
--- a/lib/nx-match.h
+++ b/lib/nx-match.h
@@ -43,9 +43,9 @@ struct nx_action_reg_move;
 
 void mf_format_subfield(const struct mf_subfield *, struct ds *);
 char *mf_parse_subfield__(struct mf_subfield *sf, const char **s)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 char *mf_parse_subfield(struct mf_subfield *, const char *s)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 enum ofperr nx_pull_match(struct ofpbuf *, unsigned int match_len,
                           struct match *,
@@ -87,7 +87,7 @@ int oxm_match_from_string(const char *, struct ofpbuf *);
 void nx_format_field_name(enum mf_field_id, enum ofp_version, struct ds *);
 
 char *nxm_parse_reg_move(struct ofpact_reg_move *, const char *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 void nxm_format_reg_move(const struct ofpact_reg_move *, struct ds *);
 
@@ -100,7 +100,7 @@ void nxm_reg_load(const struct mf_subfield *, uint64_t src_data,
                   struct flow *, struct flow_wildcards *);
 
 char *nxm_parse_stack_action(struct ofpact_stack *, const char *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 void nxm_format_stack_push(const struct ofpact_stack *, struct ds *);
 void nxm_format_stack_pop(const struct ofpact_stack *, struct ds *);
diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
index de9a31b..1b7625d 100644
--- a/lib/ofp-actions.c
+++ b/lib/ofp-actions.c
@@ -328,7 +328,7 @@ static enum ofperr ofpact_pull_raw(struct ofpbuf *, enum ofp_version,
 static void *ofpact_put_raw(struct ofpbuf *, enum ofp_version,
                             enum ofp_raw_action_type, uint64_t arg);
 
-static char *WARN_UNUSED_RESULT ofpacts_parse(
+static char *OVS_WARN_UNUSED_RESULT ofpacts_parse(
     char *str, struct ofpbuf *ofpacts, enum ofputil_protocol *usable_protocols,
     bool allow_instructions);
 
@@ -411,7 +411,7 @@ encode_OUTPUT(const struct ofpact_output *output,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_OUTPUT(const char *arg, struct ofpbuf *ofpacts,
              enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -466,7 +466,7 @@ encode_GROUP(const struct ofpact_group *group,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_GROUP(char *arg, struct ofpbuf *ofpacts,
                     enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -529,7 +529,7 @@ encode_CONTROLLER(const struct ofpact_controller *controller,
     nac->reason = controller->reason;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_CONTROLLER(char *arg, struct ofpbuf *ofpacts,
                   enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -658,7 +658,7 @@ encode_ENQUEUE(const struct ofpact_enqueue *enqueue,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_ENQUEUE(char *arg, struct ofpbuf *ofpacts,
               enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -815,7 +815,7 @@ encode_OUTPUT_REG(const struct ofpact_output_reg *output_reg,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_OUTPUT_REG(const char *arg, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1019,14 +1019,14 @@ encode_BUNDLE(const struct ofpact_bundle *bundle,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_BUNDLE(const char *arg, struct ofpbuf *ofpacts,
              enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
     return bundle_parse(arg, ofpacts);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_bundle_load(const char *arg, struct ofpbuf *ofpacts)
 {
     return bundle_parse_load(arg, ofpacts);
@@ -1089,7 +1089,7 @@ encode_SET_VLAN_VID(const struct ofpact_vlan_vid *vlan_vid,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_set_vlan_vid(char *arg, struct ofpbuf *ofpacts, bool push_vlan_if_needed)
 {
     struct ofpact_vlan_vid *vlan_vid;
@@ -1110,7 +1110,7 @@ parse_set_vlan_vid(char *arg, struct ofpbuf *ofpacts, bool push_vlan_if_needed)
     return NULL;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_VLAN_VID(char *arg, struct ofpbuf *ofpacts,
                    enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1175,7 +1175,7 @@ encode_SET_VLAN_PCP(const struct ofpact_vlan_pcp *vlan_pcp,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_set_vlan_pcp(char *arg, struct ofpbuf *ofpacts, bool push_vlan_if_needed)
 {
     struct ofpact_vlan_pcp *vlan_pcp;
@@ -1196,7 +1196,7 @@ parse_set_vlan_pcp(char *arg, struct ofpbuf *ofpacts, bool push_vlan_if_needed)
     return NULL;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_VLAN_PCP(char *arg, struct ofpbuf *ofpacts,
                    enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1238,7 +1238,7 @@ encode_STRIP_VLAN(const struct ofpact_null *null OVS_UNUSED,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_STRIP_VLAN(char *arg OVS_UNUSED, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1246,7 +1246,7 @@ parse_STRIP_VLAN(char *arg OVS_UNUSED, struct ofpbuf *ofpacts,
     return NULL;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_pop_vlan(struct ofpbuf *ofpacts)
 {
     ofpact_put_STRIP_VLAN(ofpacts)->ofpact.raw = OFPAT_RAW11_POP_VLAN;
@@ -1287,7 +1287,7 @@ encode_PUSH_VLAN(const struct ofpact_null *null OVS_UNUSED,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_PUSH_VLAN(char *arg, struct ofpbuf *ofpacts,
                 enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1378,14 +1378,14 @@ encode_SET_ETH_DST(const struct ofpact_mac *mac,
 
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_ETH_SRC(char *arg, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
     return str_to_mac(arg, ofpact_put_SET_ETH_SRC(ofpacts)->mac);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_ETH_DST(char *arg, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1450,14 +1450,14 @@ encode_SET_IPV4_DST(const struct ofpact_ipv4 *ipv4,
                          out);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_IPV4_SRC(char *arg, struct ofpbuf *ofpacts,
                    enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
     return str_to_ip(arg, &ofpact_put_SET_IPV4_SRC(ofpacts)->ipv4);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_IPV4_DST(char *arg, struct ofpbuf *ofpacts,
                    enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1501,7 +1501,7 @@ encode_SET_IP_DSCP(const struct ofpact_dscp *dscp,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_IP_DSCP(char *arg, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1553,7 +1553,7 @@ encode_SET_IP_ECN(const struct ofpact_ecn *ip_ecn,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_IP_ECN(char *arg, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1598,7 +1598,7 @@ encode_SET_IP_TTL(const struct ofpact_ip_ttl *ttl,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_IP_TTL(char *arg, struct ofpbuf *ofpacts,
                   enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1677,7 +1677,7 @@ encode_SET_L4_DST_PORT(const struct ofpact_l4_port *l4_port,
     encode_SET_L4_port(l4_port, ofp_version, OFPAT_RAW_SET_TP_DST, field, out);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_L4_SRC_PORT(char *arg, struct ofpbuf *ofpacts,
                       enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1685,7 +1685,7 @@ parse_SET_L4_SRC_PORT(char *arg, struct ofpbuf *ofpacts,
                       &ofpact_put_SET_L4_SRC_PORT(ofpacts)->port);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_L4_DST_PORT(char *arg, struct ofpbuf *ofpacts,
                       enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -1972,7 +1972,7 @@ encode_REG_MOVE(const struct ofpact_reg_move *move,
     pad_ofpat(out, start_ofs);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_REG_MOVE(const char *arg, struct ofpbuf *ofpacts,
                enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -2449,7 +2449,7 @@ encode_SET_FIELD(const struct ofpact_set_field *sf,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 set_field_parse__(char *arg, struct ofpbuf *ofpacts,
                   enum ofputil_protocol *usable_protocols)
 {
@@ -2497,7 +2497,7 @@ set_field_parse__(char *arg, struct ofpbuf *ofpacts,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_FIELD(const char *arg, struct ofpbuf *ofpacts,
                 enum ofputil_protocol *usable_protocols)
 {
@@ -2507,7 +2507,7 @@ parse_SET_FIELD(const char *arg, struct ofpbuf *ofpacts,
     return error;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_reg_load(char *arg, struct ofpbuf *ofpacts)
 {
     struct ofpact_set_field *sf = ofpact_put_reg_load(ofpacts);
@@ -2663,14 +2663,14 @@ encode_STACK_POP(const struct ofpact_stack *stack,
     encode_STACK_op(stack, put_NXAST_STACK_POP(out));
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_STACK_PUSH(char *arg, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
     return nxm_parse_stack_action(ofpact_put_STACK_PUSH(ofpacts), arg);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_STACK_POP(char *arg, struct ofpbuf *ofpacts,
                 enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -2805,7 +2805,7 @@ parse_noargs_dec_ttl(struct ofpbuf *ofpacts)
     ofpact_update_len(ofpacts, &ids->ofpact);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_DEC_TTL(char *arg, struct ofpbuf *ofpacts,
               enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -2874,7 +2874,7 @@ encode_SET_MPLS_LABEL(const struct ofpact_mpls_label *label,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_MPLS_LABEL(char *arg, struct ofpbuf *ofpacts,
                      enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -2913,7 +2913,7 @@ encode_SET_MPLS_TC(const struct ofpact_mpls_tc *tc,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_MPLS_TC(char *arg, struct ofpbuf *ofpacts,
                   enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -2954,7 +2954,7 @@ encode_SET_MPLS_TTL(const struct ofpact_mpls_ttl *ttl,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_MPLS_TTL(char *arg, struct ofpbuf *ofpacts,
                    enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -2990,7 +2990,7 @@ encode_DEC_MPLS_TTL(const struct ofpact_null *null OVS_UNUSED,
     put_OFPAT_DEC_MPLS_TTL(out, ofp_version);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_DEC_MPLS_TTL(char *arg OVS_UNUSED, struct ofpbuf *ofpacts,
                    enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -3027,7 +3027,7 @@ encode_PUSH_MPLS(const struct ofpact_push_mpls *push_mpls,
     put_OFPAT_PUSH_MPLS(out, ofp_version, push_mpls->ethertype);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_PUSH_MPLS(char *arg, struct ofpbuf *ofpacts,
                 enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -3063,7 +3063,7 @@ encode_POP_MPLS(const struct ofpact_pop_mpls *pop_mpls,
     put_OFPAT_POP_MPLS(out, ofp_version, pop_mpls->ethertype);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_POP_MPLS(char *arg, struct ofpbuf *ofpacts,
                     enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -3121,7 +3121,7 @@ encode_SET_TUNNEL(const struct ofpact_tunnel *tunnel,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_set_tunnel(char *arg, struct ofpbuf *ofpacts,
                  enum ofp_raw_action_type raw)
 {
@@ -3132,7 +3132,7 @@ parse_set_tunnel(char *arg, struct ofpbuf *ofpacts,
     return str_to_u64(arg, &tunnel->tun_id);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_TUNNEL(char *arg, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -3164,7 +3164,7 @@ encode_SET_QUEUE(const struct ofpact_queue *queue,
     put_OFPAT_SET_QUEUE(out, ofp_version, queue->queue_id);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SET_QUEUE(char *arg, struct ofpbuf *ofpacts,
                 enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -3193,7 +3193,7 @@ encode_POP_QUEUE(const struct ofpact_null *null OVS_UNUSED,
     put_NXAST_POP_QUEUE(out);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_POP_QUEUE(const char *arg OVS_UNUSED, struct ofpbuf *ofpacts,
                 enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -3263,7 +3263,7 @@ encode_FIN_TIMEOUT(const struct ofpact_fin_timeout *fin_timeout,
     naft->fin_hard_timeout = htons(fin_timeout->fin_hard_timeout);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_FIN_TIMEOUT(char *arg, struct ofpbuf *ofpacts,
                   enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -3405,7 +3405,7 @@ encode_RESUBMIT(const struct ofpact_resubmit *resubmit,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_RESUBMIT(char *arg, struct ofpbuf *ofpacts,
                enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -3885,7 +3885,7 @@ encode_LEARN(const struct ofpact_learn *learn,
     pad_ofpat(out, start_ofs);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_LEARN(char *arg, struct ofpbuf *ofpacts,
             enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -4005,7 +4005,7 @@ encode_MULTIPATH(const struct ofpact_multipath *mp,
     nam->dst = htonl(mf_nxm_header(mp->dst.field->id));
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_MULTIPATH(const char *arg, struct ofpbuf *ofpacts,
                 enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -4074,7 +4074,7 @@ encode_NOTE(const struct ofpact_note *note,
     nan->len = htons(ofpbuf_size(out) - start_ofs);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_NOTE(const char *arg, struct ofpbuf *ofpacts,
            enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -4137,7 +4137,7 @@ encode_EXIT(const struct ofpact_null *null OVS_UNUSED,
     put_NXAST_EXIT(out);
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_EXIT(char *arg OVS_UNUSED, struct ofpbuf *ofpacts,
            enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -4212,7 +4212,7 @@ encode_SAMPLE(const struct ofpact_sample *sample,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_SAMPLE(char *arg, struct ofpbuf *ofpacts,
              enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -4267,7 +4267,7 @@ encode_METER(const struct ofpact_meter *meter,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_METER(char *arg, struct ofpbuf *ofpacts,
             enum ofputil_protocol *usable_protocols)
 {
@@ -4293,7 +4293,7 @@ encode_CLEAR_ACTIONS(const struct ofpact_null *null OVS_UNUSED,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_CLEAR_ACTIONS(char *arg OVS_UNUSED, struct ofpbuf *ofpacts,
                     enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -4324,7 +4324,7 @@ encode_WRITE_ACTIONS(const struct ofpact_nest *actions,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_WRITE_ACTIONS(char *arg, struct ofpbuf *ofpacts,
                     enum ofputil_protocol *usable_protocols)
 {
@@ -4418,7 +4418,7 @@ encode_WRITE_METADATA(const struct ofpact_metadata *metadata,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_WRITE_METADATA(char *arg, struct ofpbuf *ofpacts,
                      enum ofputil_protocol *usable_protocols)
 {
@@ -4473,7 +4473,7 @@ encode_GOTO_TABLE(const struct ofpact_goto_table *goto_table,
     }
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_GOTO_TABLE(char *arg, struct ofpbuf *ofpacts,
                  enum ofputil_protocol *usable_protocols OVS_UNUSED)
 {
@@ -6065,7 +6065,7 @@ ofpact_pad(struct ofpbuf *ofpacts)
 
 
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 ofpact_parse(enum ofpact_type type, char *value, struct ofpbuf *ofpacts,
              enum ofputil_protocol *usable_protocols)
 {
@@ -6098,7 +6098,7 @@ ofpact_type_from_name(const char *name, enum ofpact_type *type)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 ofpacts_parse__(char *str, struct ofpbuf *ofpacts,
                 enum ofputil_protocol *usable_protocols,
                 bool allow_instructions)
@@ -6183,7 +6183,7 @@ ofpacts_parse__(char *str, struct ofpbuf *ofpacts,
     return NULL;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 ofpacts_parse(char *str, struct ofpbuf *ofpacts,
               enum ofputil_protocol *usable_protocols, bool allow_instructions)
 {
@@ -6196,7 +6196,7 @@ ofpacts_parse(char *str, struct ofpbuf *ofpacts,
     return error;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 ofpacts_parse_copy(const char *s_, struct ofpbuf *ofpacts,
                    enum ofputil_protocol *usable_protocols,
                    bool allow_instructions)
@@ -6217,7 +6217,7 @@ ofpacts_parse_copy(const char *s_, struct ofpbuf *ofpacts,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 ofpacts_parse_actions(const char *s, struct ofpbuf *ofpacts,
                       enum ofputil_protocol *usable_protocols)
 {
@@ -6229,7 +6229,7 @@ ofpacts_parse_actions(const char *s, struct ofpbuf *ofpacts,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 ofpacts_parse_instructions(const char *s, struct ofpbuf *ofpacts,
                            enum ofputil_protocol *usable_protocols)
 {
diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h
index e863cdc..8362aa8 100644
--- a/lib/ofp-actions.h
+++ b/lib/ofp-actions.h
@@ -749,10 +749,10 @@ uint32_t ofpacts_get_meter(const struct ofpact[], size_t ofpacts_len);
 void ofpacts_format(const struct ofpact[], size_t ofpacts_len, struct ds *);
 char *ofpacts_parse_actions(const char *, struct ofpbuf *ofpacts,
                             enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 char *ofpacts_parse_instructions(const char *, struct ofpbuf *ofpacts,
                                  enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 const char *ofpact_name(enum ofpact_type);
 
 /* Internal use by the helpers below. */
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 16c7cdc..fea1ab7 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -46,7 +46,7 @@
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 str_to_u8(const char *str, const char *name, uint8_t *valuep)
 {
     int value;
@@ -64,7 +64,7 @@ str_to_u8(const char *str, const char *name, uint8_t *valuep)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 str_to_u16(const char *str, const char *name, uint16_t *valuep)
 {
     int value;
@@ -80,7 +80,7 @@ str_to_u16(const char *str, const char *name, uint16_t *valuep)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 str_to_u32(const char *str, uint32_t *valuep)
 {
     char *tail;
@@ -103,7 +103,7 @@ str_to_u32(const char *str, uint32_t *valuep)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 str_to_u64(const char *str, uint64_t *valuep)
 {
     char *tail;
@@ -127,7 +127,7 @@ str_to_u64(const char *str, uint64_t *valuep)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 str_to_be64(const char *str, ovs_be64 *valuep)
 {
     uint64_t value = 0;
@@ -144,7 +144,7 @@ str_to_be64(const char *str, ovs_be64 *valuep)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 str_to_mac(const char *str, uint8_t mac[ETH_ADDR_LEN])
 {
     if (!ovs_scan(str, ETH_ADDR_SCAN_FMT, ETH_ADDR_SCAN_ARGS(mac))) {
@@ -157,7 +157,7 @@ str_to_mac(const char *str, uint8_t mac[ETH_ADDR_LEN])
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 str_to_ip(const char *str, ovs_be32 *ip)
 {
     struct in_addr in_addr;
@@ -213,7 +213,7 @@ parse_protocol(const char *name, const struct protocol **p_out)
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_field(const struct mf_field *mf, const char *s, struct match *match,
             enum ofputil_protocol *usable_protocols)
 {
@@ -241,7 +241,7 @@ extract_actions(char *s)
 }
 
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string,
                 enum ofputil_protocol *usable_protocols)
 {
@@ -489,7 +489,7 @@ parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_ofp_str(struct ofputil_flow_mod *fm, int command, const char *str_,
               enum ofputil_protocol *usable_protocols)
 {
@@ -506,7 +506,7 @@ parse_ofp_str(struct ofputil_flow_mod *fm, int command, const char *str_,
     return error;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_ofp_meter_mod_str__(struct ofputil_meter_mod *mm, char *string,
                           struct ofpbuf *bands, int command,
                           enum ofputil_protocol *usable_protocols)
@@ -710,7 +710,7 @@ parse_ofp_meter_mod_str__(struct ofputil_meter_mod *mm, char *string,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_ofp_meter_mod_str(struct ofputil_meter_mod *mm, const char *str_,
                         int command, enum ofputil_protocol *usable_protocols)
 {
@@ -730,7 +730,7 @@ parse_ofp_meter_mod_str(struct ofputil_meter_mod *mm, const char *str_,
     return error;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_flow_monitor_request__(struct ofputil_flow_monitor_request *fmr,
                              const char *str_, char *string,
                              enum ofputil_protocol *usable_protocols)
@@ -804,7 +804,7 @@ parse_flow_monitor_request__(struct ofputil_flow_monitor_request *fmr,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_flow_monitor_request(struct ofputil_flow_monitor_request *fmr,
                            const char *str_,
                            enum ofputil_protocol *usable_protocols)
@@ -821,7 +821,7 @@ parse_flow_monitor_request(struct ofputil_flow_monitor_request *fmr,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_ofp_flow_mod_str(struct ofputil_flow_mod *fm, const char *string,
                        uint16_t command,
                        enum ofputil_protocol *usable_protocols)
@@ -844,7 +844,7 @@ parse_ofp_flow_mod_str(struct ofputil_flow_mod *fm, const char *string,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_ofp_table_mod(struct ofputil_table_mod *tm, const char *table_id,
                     const char *flow_miss_handling,
                     enum ofputil_protocol *usable_protocols)
@@ -886,7 +886,7 @@ parse_ofp_table_mod(struct ofputil_table_mod *tm, const char *table_id,
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_ofp_flow_mod_file(const char *file_name, uint16_t command,
                         struct ofputil_flow_mod **fms, size_t *n_fms,
                         enum ofputil_protocol *usable_protocols)
@@ -947,7 +947,7 @@ parse_ofp_flow_mod_file(const char *file_name, uint16_t command,
     return NULL;
 }
 
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *fsr,
                                  bool aggregate, const char *string,
                                  enum ofputil_protocol *usable_protocols)
@@ -1087,7 +1087,7 @@ exit:
     return error;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_bucket_str(struct ofputil_bucket *bucket, char *str_,
                   enum ofputil_protocol *usable_protocols)
 {
@@ -1158,7 +1158,7 @@ parse_bucket_str(struct ofputil_bucket *bucket, char *str_,
     return NULL;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
                           char *string,
                           enum ofputil_protocol *usable_protocols)
@@ -1370,7 +1370,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
     return error;
 }
 
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_ofp_group_mod_str(struct ofputil_group_mod *gm, uint16_t command,
                         const char *str_,
                         enum ofputil_protocol *usable_protocols)
@@ -1386,7 +1386,7 @@ parse_ofp_group_mod_str(struct ofputil_group_mod *gm, uint16_t command,
     return error;
 }
 
-char * WARN_UNUSED_RESULT
+char * OVS_WARN_UNUSED_RESULT
 parse_ofp_group_mod_file(const char *file_name, uint16_t command,
                          struct ofputil_group_mod **gms, size_t *n_gms,
                          enum ofputil_protocol *usable_protocols)
diff --git a/lib/ofp-parse.h b/lib/ofp-parse.h
index 789febf..db30f43 100644
--- a/lib/ofp-parse.h
+++ b/lib/ofp-parse.h
@@ -39,27 +39,27 @@ enum ofputil_protocol;
 
 char *parse_ofp_str(struct ofputil_flow_mod *, int command, const char *str_,
                     enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *parse_ofp_flow_mod_str(struct ofputil_flow_mod *, const char *string,
                              uint16_t command,
                              enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *parse_ofp_table_mod(struct ofputil_table_mod *,
                           const char *table_id, const char *flow_miss_handling,
                           enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *parse_ofp_flow_mod_file(const char *file_name, uint16_t command,
                               struct ofputil_flow_mod **fms, size_t *n_fms,
                               enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *parse_ofp_flow_stats_request_str(struct ofputil_flow_stats_request *,
                                        bool aggregate, const char *string,
                                        enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *parse_ofp_exact_flow(struct flow *flow, struct flow *mask, const char *s,
                            const struct simap *portno_names);
@@ -67,31 +67,31 @@ char *parse_ofp_exact_flow(struct flow *flow, struct flow *mask, const char *s,
 char *parse_ofp_meter_mod_str(struct ofputil_meter_mod *, const char *string,
                               int command,
                               enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *parse_flow_monitor_request(struct ofputil_flow_monitor_request *,
                                  const char *,
                                  enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *parse_ofp_group_mod_file(const char *file_name, uint16_t command,
                                struct ofputil_group_mod **gms, size_t *n_gms,
                                enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *parse_ofp_group_mod_str(struct ofputil_group_mod *, uint16_t command,
                               const char *string,
                               enum ofputil_protocol *usable_protocols)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *str_to_u8(const char *str, const char *name, uint8_t *valuep)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 char *str_to_u16(const char *str, const char *name, uint16_t *valuep)
-    WARN_UNUSED_RESULT;
-char *str_to_u32(const char *str, uint32_t *valuep) WARN_UNUSED_RESULT;
-char *str_to_u64(const char *str, uint64_t *valuep) WARN_UNUSED_RESULT;
-char *str_to_be64(const char *str, ovs_be64 *valuep) WARN_UNUSED_RESULT;
-char *str_to_mac(const char *str, uint8_t mac[ETH_ADDR_LEN]) WARN_UNUSED_RESULT;
-char *str_to_ip(const char *str, ovs_be32 *ip) WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
+char *str_to_u32(const char *str, uint32_t *valuep) OVS_WARN_UNUSED_RESULT;
+char *str_to_u64(const char *str, uint64_t *valuep) OVS_WARN_UNUSED_RESULT;
+char *str_to_be64(const char *str, ovs_be64 *valuep) OVS_WARN_UNUSED_RESULT;
+char *str_to_mac(const char *str, uint8_t mac[ETH_ADDR_LEN]) OVS_WARN_UNUSED_RESULT;
+char *str_to_ip(const char *str, ovs_be32 *ip) OVS_WARN_UNUSED_RESULT;
 
 #endif /* ofp-parse.h */
diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index c446770..732771e 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -540,7 +540,7 @@ ofp_print_switch_config(struct ds *string, const struct ofp_switch_config *osc)
 
 static void print_wild(struct ds *string, const char *leader, int is_wild,
             int verbosity, const char *format, ...)
-            PRINTF_FORMAT(5, 6);
+            OVS_PRINTF_FORMAT(5, 6);
 
 static void print_wild(struct ds *string, const char *leader, int is_wild,
                        int verbosity, const char *format, ...)
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 839f56f..8ba6408 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -108,7 +108,7 @@ ofputil_pull_property(struct ofpbuf *msg, struct ofpbuf *property,
     return ofputil_pull_property__(msg, property, 8, typep);
 }
 
-static void PRINTF_FORMAT(2, 3)
+static void OVS_PRINTF_FORMAT(2, 3)
 log_property(bool loose, const char *message, ...)
 {
     enum vlog_level level = loose ? VLL_DBG : VLL_WARN;
diff --git a/lib/ovsdb-data.c b/lib/ovsdb-data.c
index 0706dd0..a62e92e 100644
--- a/lib/ovsdb-data.c
+++ b/lib/ovsdb-data.c
@@ -304,7 +304,7 @@ ovsdb_symbol_referenced(struct ovsdb_symbol *symbol,
     }
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 ovsdb_atom_parse_uuid(struct uuid *uuid, const struct json *json,
                       struct ovsdb_symbol_table *symtab,
                       const struct ovsdb_base_type *base)
@@ -343,7 +343,7 @@ ovsdb_atom_parse_uuid(struct uuid *uuid, const struct json *json,
     return error0;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 ovsdb_atom_from_json__(union ovsdb_atom *atom,
                        const struct ovsdb_base_type *base,
                        const struct json *json,
diff --git a/lib/ovsdb-data.h b/lib/ovsdb-data.h
index 2e31cc5..e144c70 100644
--- a/lib/ovsdb-data.h
+++ b/lib/ovsdb-data.h
@@ -85,14 +85,14 @@ struct ovsdb_error *ovsdb_atom_from_json(union ovsdb_atom *,
                                          const struct ovsdb_base_type *,
                                          const struct json *,
                                          struct ovsdb_symbol_table *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_atom_to_json(const union ovsdb_atom *,
                                 enum ovsdb_atomic_type);
 
 char *ovsdb_atom_from_string(union ovsdb_atom *,
                              const struct ovsdb_base_type *, const char *,
                              struct ovsdb_symbol_table *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 void ovsdb_atom_to_string(const union ovsdb_atom *, enum ovsdb_atomic_type,
                           struct ds *);
 void ovsdb_atom_to_bare(const union ovsdb_atom *, enum ovsdb_atomic_type,
@@ -100,7 +100,7 @@ void ovsdb_atom_to_bare(const union ovsdb_atom *, enum ovsdb_atomic_type,
 
 struct ovsdb_error *ovsdb_atom_check_constraints(
     const union ovsdb_atom *, const struct ovsdb_base_type *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 /* An instance of an OVSDB type (given by struct ovsdb_type).
  *
@@ -142,7 +142,7 @@ void ovsdb_datum_swap(struct ovsdb_datum *, struct ovsdb_datum *);
 /* Checking and maintaining invariants. */
 struct ovsdb_error *ovsdb_datum_sort(struct ovsdb_datum *,
                                      enum ovsdb_atomic_type key_type)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 void ovsdb_datum_sort_assert(struct ovsdb_datum *,
                              enum ovsdb_atomic_type key_type);
@@ -153,21 +153,21 @@ size_t ovsdb_datum_sort_unique(struct ovsdb_datum *,
 
 struct ovsdb_error *ovsdb_datum_check_constraints(
     const struct ovsdb_datum *, const struct ovsdb_type *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 /* Type conversion. */
 struct ovsdb_error *ovsdb_datum_from_json(struct ovsdb_datum *,
                                           const struct ovsdb_type *,
                                           const struct json *,
                                           struct ovsdb_symbol_table *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_datum_to_json(const struct ovsdb_datum *,
                                  const struct ovsdb_type *);
 
 char *ovsdb_datum_from_string(struct ovsdb_datum *,
                               const struct ovsdb_type *, const char *,
                               struct ovsdb_symbol_table *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 void ovsdb_datum_to_string(const struct ovsdb_datum *,
                            const struct ovsdb_type *, struct ds *);
 void ovsdb_datum_to_bare(const struct ovsdb_datum *,
@@ -255,7 +255,7 @@ struct ovsdb_symbol *ovsdb_symbol_table_insert(struct ovsdb_symbol_table *,
  *
  * Used by ovsdb_atom_from_string() and ovsdb_datum_from_string(). */
 
-char *ovsdb_token_parse(const char **, char **outp) WARN_UNUSED_RESULT;
+char *ovsdb_token_parse(const char **, char **outp) OVS_WARN_UNUSED_RESULT;
 bool ovsdb_token_is_delim(unsigned char);
 
 #endif /* ovsdb-data.h */
diff --git a/lib/ovsdb-error.h b/lib/ovsdb-error.h
index 5f39c3e..2bc259a 100644
--- a/lib/ovsdb-error.h
+++ b/lib/ovsdb-error.h
@@ -21,25 +21,25 @@
 struct json;
 
 struct ovsdb_error *ovsdb_error(const char *tag, const char *details, ...)
-    PRINTF_FORMAT(2, 3)
-    WARN_UNUSED_RESULT;
+    OVS_PRINTF_FORMAT(2, 3)
+    OVS_WARN_UNUSED_RESULT;
 struct ovsdb_error *ovsdb_io_error(int error, const char *details, ...)
-    PRINTF_FORMAT(2, 3)
-    WARN_UNUSED_RESULT;
+    OVS_PRINTF_FORMAT(2, 3)
+    OVS_WARN_UNUSED_RESULT;
 struct ovsdb_error *ovsdb_syntax_error(const struct json *, const char *tag,
                                        const char *details, ...)
-    PRINTF_FORMAT(3, 4)
-    WARN_UNUSED_RESULT;
+    OVS_PRINTF_FORMAT(3, 4)
+    OVS_WARN_UNUSED_RESULT;
 
 struct ovsdb_error *ovsdb_wrap_error(struct ovsdb_error *error,
                                      const char *details, ...)
-    PRINTF_FORMAT(2, 3);
+    OVS_PRINTF_FORMAT(2, 3);
 
 struct ovsdb_error *ovsdb_internal_error(struct ovsdb_error *error,
                                          const char *file, int line,
                                          const char *details, ...)
-    PRINTF_FORMAT(4, 5)
-    WARN_UNUSED_RESULT;
+    OVS_PRINTF_FORMAT(4, 5)
+    OVS_WARN_UNUSED_RESULT;
 
 /* Returns a pointer to an ovsdb_error that represents an internal error for
  * the current file name and line number with MSG as the associated message.
@@ -57,7 +57,7 @@ struct ovsdb_error *ovsdb_internal_error(struct ovsdb_error *error,
 
 void ovsdb_error_destroy(struct ovsdb_error *);
 struct ovsdb_error *ovsdb_error_clone(const struct ovsdb_error *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 char *ovsdb_error_to_string(const struct ovsdb_error *);
 struct json *ovsdb_error_to_json(const struct ovsdb_error *);
diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h
index 26aa2a3..54df90d 100644
--- a/lib/ovsdb-idl.h
+++ b/lib/ovsdb-idl.h
@@ -189,7 +189,7 @@ const char *ovsdb_idl_txn_status_to_string(enum ovsdb_idl_txn_status);
 
 struct ovsdb_idl_txn *ovsdb_idl_txn_create(struct ovsdb_idl *);
 void ovsdb_idl_txn_add_comment(struct ovsdb_idl_txn *, const char *, ...)
-    PRINTF_FORMAT (2, 3);
+    OVS_PRINTF_FORMAT (2, 3);
 void ovsdb_idl_txn_set_dry_run(struct ovsdb_idl_txn *);
 void ovsdb_idl_txn_increment(struct ovsdb_idl_txn *,
                              const struct ovsdb_idl_row *,
diff --git a/lib/ovsdb-parser.h b/lib/ovsdb-parser.h
index 75bf6e4..8df9d52 100644
--- a/lib/ovsdb-parser.h
+++ b/lib/ovsdb-parser.h
@@ -61,17 +61,17 @@ enum ovsdb_parser_types {
 
 void ovsdb_parser_init(struct ovsdb_parser *, const struct json *,
                        const char *name, ...)
-    PRINTF_FORMAT(3, 4);
+    OVS_PRINTF_FORMAT(3, 4);
 const struct json *ovsdb_parser_member(struct ovsdb_parser *, const char *name,
                                        enum ovsdb_parser_types);
 
 void ovsdb_parser_raise_error(struct ovsdb_parser *parser,
                               const char *format, ...)
-    PRINTF_FORMAT(2, 3);
+    OVS_PRINTF_FORMAT(2, 3);
 bool ovsdb_parser_has_error(const struct ovsdb_parser *);
 struct ovsdb_error *ovsdb_parser_get_error(const struct ovsdb_parser *);
 struct ovsdb_error *ovsdb_parser_finish(struct ovsdb_parser *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 void ovsdb_parser_destroy(struct ovsdb_parser *);
 
 bool ovsdb_parser_is_id(const char *string);
diff --git a/lib/ovsdb-types.h b/lib/ovsdb-types.h
index 5b6b0f0..81cc862 100644
--- a/lib/ovsdb-types.h
+++ b/lib/ovsdb-types.h
@@ -105,7 +105,7 @@ const struct ovsdb_type *ovsdb_base_type_get_enum_type(enum ovsdb_atomic_type);
 
 struct ovsdb_error *ovsdb_base_type_from_json(struct ovsdb_base_type *,
                                               const struct json *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_base_type_to_json(const struct ovsdb_base_type *);
 
 static inline bool ovsdb_base_type_is_ref(const struct ovsdb_base_type *);
@@ -162,7 +162,7 @@ char *ovsdb_type_to_english(const struct ovsdb_type *);
 
 struct ovsdb_error *ovsdb_type_from_json(struct ovsdb_type *,
                                          const struct json *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_type_to_json(const struct ovsdb_type *);
 
 /* Inline function implementations. */
diff --git a/lib/smap.h b/lib/smap.h
index 316cb20..caf3efc 100644
--- a/lib/smap.h
+++ b/lib/smap.h
@@ -45,7 +45,7 @@ struct smap_node *smap_add(struct smap *, const char *, const char *);
 struct smap_node *smap_add_nocopy(struct smap *, char *, char *);
 bool smap_add_once(struct smap *, const char *, const char *);
 void smap_add_format(struct smap *, const char *key, const char *, ...)
-    PRINTF_FORMAT(3, 4);
+    OVS_PRINTF_FORMAT(3, 4);
 void smap_replace(struct smap *, const char *, const char *);
 
 void smap_remove(struct smap *, const char *);
diff --git a/lib/stream-nossl.c b/lib/stream-nossl.c
index 7dc5e0f..9dda987 100644
--- a/lib/stream-nossl.c
+++ b/lib/stream-nossl.c
@@ -28,7 +28,7 @@ stream_ssl_is_configured(void)
     return false;
 }
 
-NO_RETURN static void
+OVS_NO_RETURN static void
 nossl_option(const char *detail)
 {
     VLOG_FATAL("%s specified but Open vSwitch was built without SSL support",
diff --git a/lib/table.h b/lib/table.h
index 6c8f763..85b8156 100644
--- a/lib/table.h
+++ b/lib/table.h
@@ -41,7 +41,7 @@ void table_set_caption(struct table *, char *caption);
 void table_set_timestamp(struct table *, bool timestamp);
 
 void table_add_column(struct table *, const char *heading, ...)
-    PRINTF_FORMAT(2, 3);
+    OVS_PRINTF_FORMAT(2, 3);
 void table_add_row(struct table *);
 
 /* Table cells. */
diff --git a/lib/unicode.h b/lib/unicode.h
index f5139ec..4a8baca 100644
--- a/lib/unicode.h
+++ b/lib/unicode.h
@@ -53,6 +53,6 @@ uc_is_surrogate(int c)
 int utf16_decode_surrogate_pair(int leading, int trailing);
 
 size_t utf8_length(const char *);
-char *utf8_validate(const char *, size_t *lengthp) WARN_UNUSED_RESULT;
+char *utf8_validate(const char *, size_t *lengthp) OVS_WARN_UNUSED_RESULT;
 
 #endif /* unicode.h */
diff --git a/lib/util.h b/lib/util.h
index fa23ce5..d744e23 100644
--- a/lib/util.h
+++ b/lib/util.h
@@ -77,7 +77,7 @@
 #else
 #define ovs_assert(CONDITION) ((void) (CONDITION))
 #endif
-NO_RETURN void ovs_assert_failure(const char *, const char *, const char *);
+OVS_NO_RETURN void ovs_assert_failure(const char *, const char *, const char *);
 
 /* Casts 'pointer' to 'type' and issues a compiler warning if the cast changes
  * anything other than an outermost "const" or "volatile" qualifier.
@@ -271,11 +271,11 @@ extern "C" {
         ovs_set_program_name(name, OVS_PACKAGE_VERSION)
 
 const char *get_subprogram_name(void);
-void set_subprogram_name(const char *format, ...) PRINTF_FORMAT(1, 2);
+void set_subprogram_name(const char *format, ...) OVS_PRINTF_FORMAT(1, 2);
 
 void ovs_print_version(uint8_t min_ofp, uint8_t max_ofp);
 
-NO_RETURN void out_of_memory(void);
+OVS_NO_RETURN void out_of_memory(void);
 void *xmalloc(size_t) MALLOC_LIKE;
 void *xcalloc(size_t, size_t) MALLOC_LIKE;
 void *xzalloc(size_t) MALLOC_LIKE;
@@ -283,8 +283,8 @@ void *xrealloc(void *, size_t);
 void *xmemdup(const void *, size_t) MALLOC_LIKE;
 char *xmemdup0(const char *, size_t) MALLOC_LIKE;
 char *xstrdup(const char *) MALLOC_LIKE;
-char *xasprintf(const char *format, ...) PRINTF_FORMAT(1, 2) MALLOC_LIKE;
-char *xvasprintf(const char *format, va_list) PRINTF_FORMAT(1, 0) MALLOC_LIKE;
+char *xasprintf(const char *format, ...) OVS_PRINTF_FORMAT(1, 2) MALLOC_LIKE;
+char *xvasprintf(const char *format, va_list) OVS_PRINTF_FORMAT(1, 0) MALLOC_LIKE;
 void *x2nrealloc(void *p, size_t *n, size_t s);
 
 void *xmalloc_cacheline(size_t) MALLOC_LIKE;
@@ -294,17 +294,17 @@ void free_cacheline(void *);
 void ovs_strlcpy(char *dst, const char *src, size_t size);
 void ovs_strzcpy(char *dst, const char *src, size_t size);
 
-NO_RETURN void ovs_abort(int err_no, const char *format, ...)
-    PRINTF_FORMAT(2, 3);
-NO_RETURN void ovs_abort_valist(int err_no, const char *format, va_list)
-    PRINTF_FORMAT(2, 0);
-NO_RETURN void ovs_fatal(int err_no, const char *format, ...)
-    PRINTF_FORMAT(2, 3);
-NO_RETURN void ovs_fatal_valist(int err_no, const char *format, va_list)
-    PRINTF_FORMAT(2, 0);
-void ovs_error(int err_no, const char *format, ...) PRINTF_FORMAT(2, 3);
+OVS_NO_RETURN void ovs_abort(int err_no, const char *format, ...)
+    OVS_PRINTF_FORMAT(2, 3);
+OVS_NO_RETURN void ovs_abort_valist(int err_no, const char *format, va_list)
+    OVS_PRINTF_FORMAT(2, 0);
+OVS_NO_RETURN void ovs_fatal(int err_no, const char *format, ...)
+    OVS_PRINTF_FORMAT(2, 3);
+OVS_NO_RETURN void ovs_fatal_valist(int err_no, const char *format, va_list)
+    OVS_PRINTF_FORMAT(2, 0);
+void ovs_error(int err_no, const char *format, ...) OVS_PRINTF_FORMAT(2, 3);
 void ovs_error_valist(int err_no, const char *format, va_list)
-    PRINTF_FORMAT(2, 0);
+    OVS_PRINTF_FORMAT(2, 0);
 const char *ovs_retval_to_string(int);
 const char *ovs_strerror(int);
 void ovs_hex_dump(FILE *, const void *, size_t, uintptr_t offset, bool ascii);
@@ -314,7 +314,7 @@ bool str_to_long(const char *, int base, long *);
 bool str_to_llong(const char *, int base, long long *);
 bool str_to_uint(const char *, int base, unsigned int *);
 
-bool ovs_scan(const char *s, const char *format, ...) SCANF_FORMAT(2, 3);
+bool ovs_scan(const char *s, const char *format, ...) OVS_SCANF_FORMAT(2, 3);
 bool ovs_scan_len(const char *s, int *n, const char *format, ...);
 
 bool str_to_double(const char *, double *);
diff --git a/lib/vlog.c b/lib/vlog.c
index 42e4869..a2255eb 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -113,7 +113,7 @@ static int syslog_fd OVS_GUARDED_BY(pattern_rwlock) = -1;
 static void format_log_message(const struct vlog_module *, enum vlog_level,
                                const char *pattern,
                                const char *message, va_list, struct ds *)
-    PRINTF_FORMAT(4, 0);
+    OVS_PRINTF_FORMAT(4, 0);
 
 /* Searches the 'n_names' in 'names'.  Returns the index of a match for
  * 'target', or 'n_names' if no name matches. */
diff --git a/lib/vlog.h b/lib/vlog.h
index 974a301..d0ada03 100644
--- a/lib/vlog.h
+++ b/lib/vlog.h
@@ -127,7 +127,7 @@ struct vlog_rate_limit {
 enum vlog_level vlog_get_level(const struct vlog_module *, enum vlog_facility);
 void vlog_set_levels(struct vlog_module *,
                      enum vlog_facility, enum vlog_level);
-char *vlog_set_levels_from_string(const char *) WARN_UNUSED_RESULT;
+char *vlog_set_levels_from_string(const char *) OVS_WARN_UNUSED_RESULT;
 void vlog_set_levels_from_string_assert(const char *);
 char *vlog_get_levels(void);
 bool vlog_is_enabled(const struct vlog_module *, enum vlog_level);
@@ -149,26 +149,26 @@ void vlog_enable_async(void);
 
 /* Functions for actual logging. */
 void vlog(const struct vlog_module *, enum vlog_level, const char *format, ...)
-    PRINTF_FORMAT (3, 4);
+    OVS_PRINTF_FORMAT (3, 4);
 void vlog_valist(const struct vlog_module *, enum vlog_level,
                  const char *, va_list)
-    PRINTF_FORMAT (3, 0);
+    OVS_PRINTF_FORMAT (3, 0);
 
-NO_RETURN void vlog_fatal(const struct vlog_module *, const char *format, ...)
-    PRINTF_FORMAT (2, 3);
-NO_RETURN void vlog_fatal_valist(const struct vlog_module *,
+OVS_NO_RETURN void vlog_fatal(const struct vlog_module *, const char *format, ...)
+    OVS_PRINTF_FORMAT (2, 3);
+OVS_NO_RETURN void vlog_fatal_valist(const struct vlog_module *,
                                  const char *format, va_list)
-    PRINTF_FORMAT (2, 0);
+    OVS_PRINTF_FORMAT (2, 0);
 
-NO_RETURN void vlog_abort(const struct vlog_module *, const char *format, ...)
-    PRINTF_FORMAT (2, 3);
-NO_RETURN void vlog_abort_valist(const struct vlog_module *,
+OVS_NO_RETURN void vlog_abort(const struct vlog_module *, const char *format, ...)
+    OVS_PRINTF_FORMAT (2, 3);
+OVS_NO_RETURN void vlog_abort_valist(const struct vlog_module *,
                                  const char *format, va_list)
-    PRINTF_FORMAT (2, 0);
+    OVS_PRINTF_FORMAT (2, 0);
 
 void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
                      struct vlog_rate_limit *, const char *, ...)
-    PRINTF_FORMAT (4, 5);
+    OVS_PRINTF_FORMAT (4, 5);
 
 /* Creates and initializes a global instance of a module named MODULE, and
  * defines a static variable named THIS_MODULE that points to it, for use with
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 5b3e64c..1a94021 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4515,7 +4515,7 @@ trace_report(struct xlate_in *xin, const char *s, int recurse)
  *
  * On success, initializes '*ofprotop' and 'flow' and returns NULL.  On failure
  * returns a nonnull malloced error message. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_flow_and_packet(int argc, const char *argv[],
                       struct ofproto_dpif **ofprotop, struct flow *flow,
                       struct ofpbuf **packetp)
diff --git a/ovsdb/column.h b/ovsdb/column.h
index 60ba478..f75a107 100644
--- a/ovsdb/column.h
+++ b/ovsdb/column.h
@@ -53,7 +53,7 @@ void ovsdb_column_destroy(struct ovsdb_column *);
 struct ovsdb_error *ovsdb_column_from_json(const struct json *,
                                            const char *name,
                                            struct ovsdb_column **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_column_to_json(const struct ovsdb_column *);
 
 /* An unordered set of distinct columns. */
diff --git a/ovsdb/condition.c b/ovsdb/condition.c
index 570f14d..4baf1bb 100644
--- a/ovsdb/condition.c
+++ b/ovsdb/condition.c
@@ -52,7 +52,7 @@ ovsdb_function_to_string(enum ovsdb_function function)
     return NULL;
 }
 
-static WARN_UNUSED_RESULT struct ovsdb_error *
+static OVS_WARN_UNUSED_RESULT struct ovsdb_error *
 ovsdb_clause_from_json(const struct ovsdb_table_schema *ts,
                        const struct json *json,
                        struct ovsdb_symbol_table *symtab,
diff --git a/ovsdb/condition.h b/ovsdb/condition.h
index ae6159c..620757f 100644
--- a/ovsdb/condition.h
+++ b/ovsdb/condition.h
@@ -44,7 +44,7 @@ enum ovsdb_function {
 
 struct ovsdb_error *ovsdb_function_from_string(const char *,
                                                enum ovsdb_function *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 const char *ovsdb_function_to_string(enum ovsdb_function);
 
 struct ovsdb_clause {
@@ -63,7 +63,7 @@ struct ovsdb_condition {
 struct ovsdb_error *ovsdb_condition_from_json(
     const struct ovsdb_table_schema *,
     const struct json *, struct ovsdb_symbol_table *,
-    struct ovsdb_condition *) WARN_UNUSED_RESULT;
+    struct ovsdb_condition *) OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_condition_to_json(const struct ovsdb_condition *);
 void ovsdb_condition_destroy(struct ovsdb_condition *);
 bool ovsdb_condition_evaluate(const struct ovsdb_row *,
diff --git a/ovsdb/execution.c b/ovsdb/execution.c
index 2be131d..de25a87 100644
--- a/ovsdb/execution.c
+++ b/ovsdb/execution.c
@@ -247,7 +247,7 @@ parse_table(struct ovsdb_execution *x,
     return table;
 }
 
-static WARN_UNUSED_RESULT struct ovsdb_error *
+static OVS_WARN_UNUSED_RESULT struct ovsdb_error *
 parse_row(const struct json *json, const struct ovsdb_table *table,
           struct ovsdb_symbol_table *symtab,
           struct ovsdb_row **rowp, struct ovsdb_column_set *columns)
diff --git a/ovsdb/file.h b/ovsdb/file.h
index 5d76a73..ee67b12 100644
--- a/ovsdb/file.h
+++ b/ovsdb/file.h
@@ -26,22 +26,22 @@ struct ovsdb_schema;
 
 struct ovsdb_error *ovsdb_file_open(const char *file_name, bool read_only,
                                     struct ovsdb **, struct ovsdb_file **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 struct ovsdb_error *ovsdb_file_open_as_schema(const char *file_name,
                                               const struct ovsdb_schema *,
                                               struct ovsdb **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 struct ovsdb_error *ovsdb_file_save_copy(const char *file_name, int locking,
                                          const char *comment,
                                          const struct ovsdb *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 struct ovsdb_error *ovsdb_file_compact(struct ovsdb_file *);
 
 struct ovsdb_error *ovsdb_file_read_schema(const char *file_name,
                                            struct ovsdb_schema **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 #endif /* ovsdb/file.h */
diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c
index cfaa656..639f2ff 100644
--- a/ovsdb/jsonrpc-server.c
+++ b/ovsdb/jsonrpc-server.c
@@ -1139,7 +1139,7 @@ compare_ovsdb_jsonrpc_monitor_column(const void *a_, const void *b_)
     return a->column < b->column ? -1 : a->column > b->column;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 ovsdb_jsonrpc_parse_monitor_request(struct ovsdb_jsonrpc_monitor_table *mt,
                                     const struct json *monitor_request,
                                     size_t *allocated_columns)
diff --git a/ovsdb/log.h b/ovsdb/log.h
index aad2543..5fe636b 100644
--- a/ovsdb/log.h
+++ b/ovsdb/log.h
@@ -31,17 +31,17 @@ enum ovsdb_log_open_mode {
 
 struct ovsdb_error *ovsdb_log_open(const char *name, enum ovsdb_log_open_mode,
                                    int locking, struct ovsdb_log **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 void ovsdb_log_close(struct ovsdb_log *);
 
 struct ovsdb_error *ovsdb_log_read(struct ovsdb_log *, struct json **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 void ovsdb_log_unread(struct ovsdb_log *);
 
 struct ovsdb_error *ovsdb_log_write(struct ovsdb_log *, struct json *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct ovsdb_error *ovsdb_log_commit(struct ovsdb_log *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 off_t ovsdb_log_get_offset(const struct ovsdb_log *);
 
diff --git a/ovsdb/mutation.c b/ovsdb/mutation.c
index 967ad15..6a43e34 100644
--- a/ovsdb/mutation.c
+++ b/ovsdb/mutation.c
@@ -53,7 +53,7 @@ ovsdb_mutator_to_string(enum ovsdb_mutator mutator)
     return NULL;
 }
 
-static WARN_UNUSED_RESULT struct ovsdb_error *
+static OVS_WARN_UNUSED_RESULT struct ovsdb_error *
 type_mismatch(const struct ovsdb_mutation *m, const struct json *json)
 {
     struct ovsdb_error *error;
@@ -69,7 +69,7 @@ type_mismatch(const struct ovsdb_mutation *m, const struct json *json)
     return error;
 }
 
-static WARN_UNUSED_RESULT struct ovsdb_error *
+static OVS_WARN_UNUSED_RESULT struct ovsdb_error *
 ovsdb_mutation_from_json(const struct ovsdb_table_schema *ts,
                          const struct json *json,
                          struct ovsdb_symbol_table *symtab,
diff --git a/ovsdb/mutation.h b/ovsdb/mutation.h
index a6545e4..7566ef1 100644
--- a/ovsdb/mutation.h
+++ b/ovsdb/mutation.h
@@ -43,7 +43,7 @@ enum ovsdb_mutator {
 
 struct ovsdb_error *ovsdb_mutator_from_string(const char *,
                                               enum ovsdb_mutator *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 const char *ovsdb_mutator_to_string(enum ovsdb_mutator);
 
 struct ovsdb_mutation {
@@ -63,10 +63,10 @@ struct ovsdb_mutation_set {
 struct ovsdb_error *ovsdb_mutation_set_from_json(
     const struct ovsdb_table_schema *,
     const struct json *, struct ovsdb_symbol_table *,
-    struct ovsdb_mutation_set *) WARN_UNUSED_RESULT;
+    struct ovsdb_mutation_set *) OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_mutation_set_to_json(const struct ovsdb_mutation_set *);
 void ovsdb_mutation_set_destroy(struct ovsdb_mutation_set *);
 struct ovsdb_error *ovsdb_mutation_set_execute(
-    struct ovsdb_row *, const struct ovsdb_mutation_set *) WARN_UNUSED_RESULT;
+    struct ovsdb_row *, const struct ovsdb_mutation_set *) OVS_WARN_UNUSED_RESULT;
 
 #endif /* ovsdb/mutation.h */
diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c
index 2f1a837..2d4c4db 100644
--- a/ovsdb/ovsdb-client.c
+++ b/ovsdb/ovsdb-client.c
@@ -74,7 +74,7 @@ static struct table_style table_style = TABLE_STYLE_DEFAULT;
 
 static const struct ovsdb_client_command *get_all_commands(void);
 
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[]);
 static struct jsonrpc *open_jsonrpc(const char *server);
 static void fetch_dbs(struct jsonrpc *, struct svec *dbs);
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 6219110..faa7741 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -97,7 +97,7 @@ static void close_db(struct db *db);
 static void parse_options(int *argc, char **argvp[],
                           struct sset *remotes, char **unixctl_pathp,
                           char **run_command);
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 
 static char *reconfigure_remotes(struct ovsdb_jsonrpc_server *,
                                  const struct shash *all_dbs,
@@ -428,7 +428,7 @@ find_db(const struct shash *all_dbs, const char *db_name)
     return NULL;
 }
 
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_db_column__(const struct shash *all_dbs,
                   const char *name_, char *name,
                   const struct db **dbp,
@@ -482,7 +482,7 @@ parse_db_column__(const struct shash *all_dbs,
 
 /* Returns NULL if successful, otherwise a malloc()'d string describing the
  * error. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_db_column(const struct shash *all_dbs,
                 const char *name_,
                 const struct db **dbp,
@@ -498,7 +498,7 @@ parse_db_column(const struct shash *all_dbs,
 
 /* Returns NULL if successful, otherwise a malloc()'d string describing the
  * error. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_db_string_column(const struct shash *all_dbs,
                        const char *name,
                        const struct db **dbp,
diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c
index 509668c..a33969b 100644
--- a/ovsdb/ovsdb-tool.c
+++ b/ovsdb/ovsdb-tool.c
@@ -46,7 +46,7 @@ static int show_log_verbosity;
 
 static const struct command *get_all_commands(void);
 
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[]);
 
 static const char *default_db(void);
diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c
index e27d0de..56d2333 100644
--- a/ovsdb/ovsdb.c
+++ b/ovsdb/ovsdb.c
@@ -103,7 +103,7 @@ ovsdb_schema_from_file(const char *file_name, struct ovsdb_schema **schemap)
     return NULL;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 ovsdb_schema_check_ref_table(struct ovsdb_column *column,
                              const struct shash *tables,
                              const struct ovsdb_base_type *base,
diff --git a/ovsdb/ovsdb.h b/ovsdb/ovsdb.h
index e976d3b..1103e6d 100644
--- a/ovsdb/ovsdb.h
+++ b/ovsdb/ovsdb.h
@@ -44,10 +44,10 @@ void ovsdb_schema_destroy(struct ovsdb_schema *);
 
 struct ovsdb_error *ovsdb_schema_from_file(const char *file_name,
                                            struct ovsdb_schema **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct ovsdb_error *ovsdb_schema_from_json(struct json *,
                                            struct ovsdb_schema **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_schema_to_json(const struct ovsdb_schema *);
 
 bool ovsdb_schema_equal(const struct ovsdb_schema *,
diff --git a/ovsdb/row.h b/ovsdb/row.h
index 45c7fb3..8920a0e 100644
--- a/ovsdb/row.h
+++ b/ovsdb/row.h
@@ -88,7 +88,7 @@ struct ovsdb_error *ovsdb_row_from_json(struct ovsdb_row *,
                                         const struct json *,
                                         struct ovsdb_symbol_table *,
                                         struct ovsdb_column_set *included)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_row_to_json(const struct ovsdb_row *,
                                const struct ovsdb_column_set *include);
 
diff --git a/ovsdb/table.h b/ovsdb/table.h
index fab9c5b..68a59ad 100644
--- a/ovsdb/table.h
+++ b/ovsdb/table.h
@@ -44,7 +44,7 @@ void ovsdb_table_schema_destroy(struct ovsdb_table_schema *);
 struct ovsdb_error *ovsdb_table_schema_from_json(const struct json *,
                                                  const char *name,
                                                  struct ovsdb_table_schema **)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 struct json *ovsdb_table_schema_to_json(const struct ovsdb_table_schema *,
                                         bool default_is_root);
 
diff --git a/ovsdb/transaction.c b/ovsdb/transaction.c
index be40df9..c620dee 100644
--- a/ovsdb/transaction.c
+++ b/ovsdb/transaction.c
@@ -84,10 +84,10 @@ struct ovsdb_txn_row {
     unsigned long changed[];    /* Bits set to 1 for columns that changed. */
 };
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 delete_garbage_row(struct ovsdb_txn *txn, struct ovsdb_txn_row *r);
 static void ovsdb_txn_row_prefree(struct ovsdb_txn_row *);
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 for_each_txn_row(struct ovsdb_txn *txn,
                       struct ovsdb_error *(*)(struct ovsdb_txn *,
                                               struct ovsdb_txn_row *));
@@ -204,7 +204,7 @@ find_or_make_txn_row(struct ovsdb_txn *txn, const struct ovsdb_table *table,
     return txn_row;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 ovsdb_txn_adjust_atom_refs(struct ovsdb_txn *txn, const struct ovsdb_row *r,
                            const struct ovsdb_column *c,
                            const struct ovsdb_base_type *base,
@@ -244,7 +244,7 @@ ovsdb_txn_adjust_atom_refs(struct ovsdb_txn *txn, const struct ovsdb_row *r,
     return NULL;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 ovsdb_txn_adjust_row_refs(struct ovsdb_txn *txn, const struct ovsdb_row *r,
                           const struct ovsdb_column *column, int delta)
 {
@@ -260,7 +260,7 @@ ovsdb_txn_adjust_row_refs(struct ovsdb_txn *txn, const struct ovsdb_row *r,
     return error;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 update_row_ref_count(struct ovsdb_txn *txn, struct ovsdb_txn_row *r)
 {
     struct ovsdb_table *table = r->table;
@@ -287,7 +287,7 @@ update_row_ref_count(struct ovsdb_txn *txn, struct ovsdb_txn_row *r)
     return NULL;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 check_ref_count(struct ovsdb_txn *txn OVS_UNUSED, struct ovsdb_txn_row *r)
 {
     if (r->new || !r->n_refs) {
@@ -301,7 +301,7 @@ check_ref_count(struct ovsdb_txn *txn OVS_UNUSED, struct ovsdb_txn_row *r)
     }
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 delete_row_refs(struct ovsdb_txn *txn, const struct ovsdb_row *row,
                 const struct ovsdb_base_type *base,
                 const union ovsdb_atom *atoms, unsigned int n)
@@ -343,7 +343,7 @@ delete_row_refs(struct ovsdb_txn *txn, const struct ovsdb_row *row,
     return NULL;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 delete_garbage_row(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
 {
     struct shash_node *node;
@@ -378,7 +378,7 @@ delete_garbage_row(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
     return NULL;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 collect_garbage(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
 {
     if (txn_row->new && !txn_row->n_refs) {
@@ -387,7 +387,7 @@ collect_garbage(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
     return NULL;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 update_ref_counts(struct ovsdb_txn *txn)
 {
     struct ovsdb_error *error;
@@ -462,7 +462,7 @@ add_weak_ref(struct ovsdb_txn *txn,
     list_push_back(&src->src_refs, &weak->src_node);
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 assess_weak_refs(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
 {
     struct ovsdb_table *table;
@@ -569,7 +569,7 @@ assess_weak_refs(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
     return NULL;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 determine_changes(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
 {
     struct ovsdb_table *table = txn_row->table;
@@ -603,7 +603,7 @@ determine_changes(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
     return NULL;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 check_max_rows(struct ovsdb_txn *txn)
 {
     struct ovsdb_txn_table *t;
@@ -672,7 +672,7 @@ duplicate_index_row__(const struct ovsdb_column_set *index,
     }
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 duplicate_index_row(const struct ovsdb_column_set *index,
                     const struct ovsdb_row *a,
                     const struct ovsdb_row *b)
@@ -711,7 +711,7 @@ duplicate_index_row(const struct ovsdb_column_set *index,
     return error;
 }
 
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 check_index_uniqueness(struct ovsdb_txn *txn OVS_UNUSED,
                        struct ovsdb_txn_row *txn_row)
 {
@@ -1013,7 +1013,7 @@ ovsdb_txn_table_destroy(struct ovsdb_txn_table *txn_table)
  * (Even though 'cb' is not allowed to delete some txn_rows, it can still
  * delete any actual row by clearing a txn_row's 'new' member.)
  */
-static struct ovsdb_error * WARN_UNUSED_RESULT
+static struct ovsdb_error * OVS_WARN_UNUSED_RESULT
 for_each_txn_row(struct ovsdb_txn *txn,
                  struct ovsdb_error *(*cb)(struct ovsdb_txn *,
                                            struct ovsdb_txn_row *))
diff --git a/ovsdb/transaction.h b/ovsdb/transaction.h
index edc9118..1ecd15a 100644
--- a/ovsdb/transaction.h
+++ b/ovsdb/transaction.h
@@ -27,7 +27,7 @@ struct uuid;
 struct ovsdb_txn *ovsdb_txn_create(struct ovsdb *);
 void ovsdb_txn_abort(struct ovsdb_txn *);
 struct ovsdb_error *ovsdb_txn_commit(struct ovsdb_txn *, bool durable)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
 
 struct ovsdb_row *ovsdb_txn_row_modify(struct ovsdb_txn *,
                                        const struct ovsdb_row *);
diff --git a/tests/test-jsonrpc.c b/tests/test-jsonrpc.c
index dc56012..fe7d869 100644
--- a/tests/test-jsonrpc.c
+++ b/tests/test-jsonrpc.c
@@ -33,7 +33,7 @@
 #include "util.h"
 #include "vlog.h"
 
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[]);
 static struct command *get_all_commands(void);
 
diff --git a/tests/test-netflow.c b/tests/test-netflow.c
index 90f6e45..b1b7717 100644
--- a/tests/test-netflow.c
+++ b/tests/test-netflow.c
@@ -34,7 +34,7 @@
 #include "util.h"
 #include "vlog.h"
 
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[]);
 
 static unixctl_cb_func test_netflow_exit;
diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c
index b95f1db..b113b9d 100644
--- a/tests/test-ovsdb.c
+++ b/tests/test-ovsdb.c
@@ -51,7 +51,7 @@
 #include "util.h"
 #include "vlog.h"
 
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[]);
 static struct command *get_all_commands(void);
 
diff --git a/tests/test-rstp.c b/tests/test-rstp.c
index 641320d..c5e7a56 100644
--- a/tests/test-rstp.c
+++ b/tests/test-rstp.c
@@ -335,9 +335,9 @@ simulate(struct test_case *tc, int granularity)
     }
 }
 
-NO_RETURN static void
+OVS_NO_RETURN static void
 err(const char *message, ...)
-    PRINTF_FORMAT(1, 2);
+    OVS_PRINTF_FORMAT(1, 2);
 
 static void
 err(const char *message, ...)
@@ -355,7 +355,7 @@ err(const char *message, ...)
 
 static void
 warn(const char *message, ...)
-    PRINTF_FORMAT(1, 2);
+    OVS_PRINTF_FORMAT(1, 2);
 
 static void
 warn(const char *message, ...)
diff --git a/tests/test-sflow.c b/tests/test-sflow.c
index c37288f..0bd5570 100644
--- a/tests/test-sflow.c
+++ b/tests/test-sflow.c
@@ -37,7 +37,7 @@
 #include "util.h"
 #include "vlog.h"
 
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[]);
 
 static unixctl_cb_func test_sflow_exit;
diff --git a/tests/test-stp.c b/tests/test-stp.c
index 22ff484..88a138d 100644
--- a/tests/test-stp.c
+++ b/tests/test-stp.c
@@ -316,9 +316,9 @@ simulate(struct test_case *tc, int granularity)
     }
 }
 
-NO_RETURN static void
+OVS_NO_RETURN static void
 err(const char *message, ...)
-    PRINTF_FORMAT(1, 2);
+    OVS_PRINTF_FORMAT(1, 2);
 
 static void
 err(const char *message, ...)
@@ -336,7 +336,7 @@ err(const char *message, ...)
 
 static void
 warn(const char *message, ...)
-    PRINTF_FORMAT(1, 2);
+    OVS_PRINTF_FORMAT(1, 2);
 
 static void
 warn(const char *message, ...)
diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c
index 5537d2f..ef4550b 100644
--- a/utilities/ovs-dpctl.c
+++ b/utilities/ovs-dpctl.c
@@ -44,7 +44,7 @@
 
 static struct dpctl_params dpctl_p;
 
-NO_RETURN static void usage(void *userdata OVS_UNUSED);
+OVS_NO_RETURN static void usage(void *userdata OVS_UNUSED);
 static void parse_options(int argc, char *argv[]);
 
 static void
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index b840a70..b078f93 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -106,7 +106,7 @@ static size_t n_criteria, allocated_criteria;
 
 static const struct command *get_all_commands(void);
 
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[]);
 
 static bool recv_flow_stats_reply(struct vconn *, ovs_be32 send_xid,
@@ -395,7 +395,7 @@ ofctl_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
 }
 
 static void run(int retval, const char *message, ...)
-    PRINTF_FORMAT(2, 3);
+    OVS_PRINTF_FORMAT(2, 3);
 
 static void
 run(int retval, const char *message, ...)
diff --git a/utilities/ovs-testcontroller.c b/utilities/ovs-testcontroller.c
index 4ef7d4b..5a5923b 100644
--- a/utilities/ovs-testcontroller.c
+++ b/utilities/ovs-testcontroller.c
@@ -91,7 +91,7 @@ static char *unixctl_path = NULL;
 
 static void new_switch(struct switch_ *, struct vconn *);
 static void parse_options(int argc, char *argv[]);
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 
 int
 main(int argc, char *argv[])
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
index e33d79d..b799557 100644
--- a/utilities/ovs-vsctl.c
+++ b/utilities/ovs-vsctl.c
@@ -137,10 +137,10 @@ static const struct vsctl_command_syntax *get_all_commands(void);
 static struct ovsdb_idl *the_idl;
 static struct ovsdb_idl_txn *the_idl_txn;
 
-NO_RETURN static void vsctl_exit(int status);
-NO_RETURN static void vsctl_fatal(const char *, ...) PRINTF_FORMAT(1, 2);
+OVS_NO_RETURN static void vsctl_exit(int status);
+OVS_NO_RETURN static void vsctl_fatal(const char *, ...) OVS_PRINTF_FORMAT(1, 2);
 static char *default_db(void);
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[], struct shash *local_options);
 static bool might_write_to_db(char **argv);
 
@@ -2886,7 +2886,7 @@ missing_operator_error(const char *arg, const char **allowed_operators,
  *
  * On success, returns NULL.  On failure, returned a malloc()'d string error
  * message and stores NULL into all of the nonnull output arguments. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_column_key_value(const char *arg,
                        const struct vsctl_table_class *table,
                        const struct ovsdb_idl_column **columnp, char **keyp,
diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c
index 3c82f0f..392e2c7 100644
--- a/vswitchd/ovs-vswitchd.c
+++ b/vswitchd/ovs-vswitchd.c
@@ -59,7 +59,7 @@ static bool want_mlockall;
 static unixctl_cb_func ovs_vswitchd_exit;
 
 static char *parse_options(int argc, char *argv[], char **unixctl_path);
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 
 int
 main(int argc, char *argv[])
diff --git a/vswitchd/system-stats.c b/vswitchd/system-stats.c
index dc0f2c5..42ac01a 100644
--- a/vswitchd/system-stats.c
+++ b/vswitchd/system-stats.c
@@ -531,7 +531,7 @@ static bool enabled;
 static bool started OVS_GUARDED_BY(mutex);
 static struct smap *system_stats OVS_GUARDED_BY(mutex);
 
-NO_RETURN static void *system_stats_thread_func(void *);
+OVS_NO_RETURN static void *system_stats_thread_func(void *);
 static void discard_stats(void);
 
 /* Enables or disables system stats collection, according to 'enable'. */
diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c
index b3ff671..b7a6d2c 100644
--- a/vtep/vtep-ctl.c
+++ b/vtep/vtep-ctl.c
@@ -121,10 +121,10 @@ static struct table_style table_style = TABLE_STYLE_DEFAULT;
 static struct ovsdb_idl *the_idl;
 static struct ovsdb_idl_txn *the_idl_txn;
 
-NO_RETURN static void vtep_ctl_exit(int status);
-NO_RETURN static void vtep_ctl_fatal(const char *, ...) PRINTF_FORMAT(1, 2);
+OVS_NO_RETURN static void vtep_ctl_exit(int status);
+OVS_NO_RETURN static void vtep_ctl_fatal(const char *, ...) OVS_PRINTF_FORMAT(1, 2);
 static char *default_db(void);
-NO_RETURN static void usage(void);
+OVS_NO_RETURN static void usage(void);
 static void parse_options(int argc, char *argv[], struct shash *local_options);
 static bool might_write_to_db(char **argv);
 
@@ -2586,7 +2586,7 @@ missing_operator_error(const char *arg, const char **allowed_operators,
  *
  * On success, returns NULL.  On failure, returned a malloc()'d string error
  * message and stores NULL into all of the nonnull output arguments. */
-static char * WARN_UNUSED_RESULT
+static char * OVS_WARN_UNUSED_RESULT
 parse_column_key_value(const char *arg,
                        const struct vtep_ctl_table_class *table,
                        const struct ovsdb_idl_column **columnp, char **keyp,
-- 
1.9.3




More information about the dev mailing list