-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
OVS_ENABLE_OPTION([-Wno-sign-compare])
OVS_ENABLE_OPTION([-Wpointer-arith])
OVS_ENABLE_OPTION([-Wformat-security])
-OVS_ENABLE_OPTION([-Wno-format-zero-length])
OVS_ENABLE_OPTION([-Wswitch-enum])
OVS_ENABLE_OPTION([-Wunused-parameter])
OVS_ENABLE_OPTION([-Wbad-function-cast])
buildflags := $(shell if dpkg-buildflags --export=configure >/dev/null 2>&1; \
then dpkg-buildflags --export=configure; fi)
-# dpkg-buildflags tends to turn on -Wformat, which is admirable, but
-# the -Wformat-zero-length subset of that option triggers a couple of
-# false positives in Open vSwitch so turn it right back off again.
-# (We do this in configure.ac also, but the Debian buildflags override
-# those.)
-buildflags := $(patsubst -Wformat,-Wformat -Wno-format-zero-length,$(buildflags))
-
configure: configure-stamp
configure-stamp:
dh_testdir
/*
- * Copyright (c) 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/* The order of the following calls is important, because
* ovsrcu_quiesce_end() saves a copy of the thread name. */
- set_subprogram_name("%s%u", aux.name, id);
+ char *subprogram_name = xasprintf("%s%u", aux.name, id);
+ set_subprogram_name(subprogram_name);
+ free(subprogram_name);
ovsrcu_quiesce_end();
return aux.start(aux.arg);
return name ? name : "";
}
-/* Sets the formatted value of 'format' as the name of the currently running
- * thread or process. (This appears in log messages and may also be visible in
- * system process listings and debuggers.) */
+/* Sets 'subprogram_name' as the name of the currently running thread or
+ * process. (This appears in log messages and may also be visible in system
+ * process listings and debuggers.) */
void
-set_subprogram_name(const char *format, ...)
+set_subprogram_name(const char *subprogram_name)
{
- char *pname;
-
- if (format) {
- va_list args;
-
- va_start(args, format);
- pname = xvasprintf(format, args);
- va_end(args);
- } else {
- pname = xstrdup(program_name);
- }
-
+ char *pname = xstrdup(subprogram_name ? subprogram_name : program_name);
free(subprogram_name_set(pname));
#if HAVE_GLIBC_PTHREAD_SETNAME_NP
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
ovs_set_program_name(name, OVS_PACKAGE_VERSION)
const char *get_subprogram_name(void);
-void set_subprogram_name(const char *format, ...) OVS_PRINTF_FORMAT(1, 2);
+ void set_subprogram_name(const char *);
void ovs_print_version(uint8_t min_ofp, uint8_t max_ofp);
/*
- * Copyright (c) 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
long l, l2;
int i, i2;
- ovs_assert(ovs_scan("", ""));
ovs_assert(ovs_scan("", " "));
ovs_assert(ovs_scan(" ", " "));
ovs_assert(ovs_scan(" ", " "));