summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorGurucharan Shetty <gshetty@nicira.com>2014-09-15 12:58:09 -0700
committerGurucharan Shetty <gshetty@nicira.com>2014-09-15 15:15:35 -0700
commit270f328621bfd8f80659150d5d3eec51754b5bfb (patch)
treec068c18ce82dcee21750e55f61ee2b3e4e157064 /utilities
parentd72eff6cec01187d9b6b0f8befdbdec0943e6012 (diff)
downloadopenvswitch-270f328621bfd8f80659150d5d3eec51754b5bfb.tar.gz
compiler: Define NO_RETURN for MSVC.
To prevent warnings such as "Not all control paths return a value", we should define NO_RETURN for MSVC. Currently for gcc, we add NO_RETURN at the end of function declaration. But for MSVC, "__declspec(noreturn)" is needed at the beginning of function declaration. So this commit moves NO_RETURN to the beginning of the function declaration as it works with gcc and clang too. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'utilities')
-rw-r--r--utilities/ovs-dpctl.c2
-rw-r--r--utilities/ovs-ofctl.c2
-rw-r--r--utilities/ovs-testcontroller.c2
-rw-r--r--utilities/ovs-vsctl.c6
4 files changed, 6 insertions, 6 deletions
diff --git a/utilities/ovs-dpctl.c b/utilities/ovs-dpctl.c
index 6c25bfdbf..94a6b90f2 100644
--- a/utilities/ovs-dpctl.c
+++ b/utilities/ovs-dpctl.c
@@ -44,7 +44,7 @@
static struct dpctl_params dpctl_p;
-static void usage(void *userdata OVS_UNUSED) NO_RETURN;
+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 30cdf99b8..4a9015509 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);
-static void usage(void) NO_RETURN;
+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,
diff --git a/utilities/ovs-testcontroller.c b/utilities/ovs-testcontroller.c
index a615ab49c..4ef7d4bb4 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[]);
-static void usage(void) NO_RETURN;
+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 5cf12cf66..818184ae3 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;
-static void vsctl_exit(int status) NO_RETURN;
-static void vsctl_fatal(const char *, ...) PRINTF_FORMAT(1, 2) NO_RETURN;
+NO_RETURN static void vsctl_exit(int status);
+NO_RETURN static void vsctl_fatal(const char *, ...) PRINTF_FORMAT(1, 2);
static char *default_db(void);
-static void usage(void) NO_RETURN;
+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);