diff options
author | Ben Pfaff <blp@nicira.com> | 2015-06-07 09:48:14 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2015-06-10 09:19:39 -0700 |
commit | 40e7cf5607052d3b4fa09fd433fa630352c115b6 (patch) | |
tree | 4480696260487d892a041a299f5d6820c7556f2d /lib/ovs-thread.c | |
parent | bdd7ecf5bfc4a255872aa60057b3b96f72b47d8a (diff) | |
download | openvswitch-40e7cf5607052d3b4fa09fd433fa630352c115b6.tar.gz |
configure: Stop avoiding -Wformat-zero-length.
Debian likes to enable -Wformat-zero-length, even over our code trying to
disable it. It isn't too hard to make our code warning-free against this
option, so this commit both stops disabling it and fixes the warnings.
The first fix is to change set_subprogram_name() to take a plain string
instead of a format string, and to adjust its few callers. This fixes one
warning since one of those callers passed in an empty string.
The second fix is to remove a test for ovs_scan() against an empty string.
I couldn't find a way to avoid a warning for this test, and it isn't too
valuable in any case.
This allows us to drop filtering for -Wformat from the Debian rules file,
so this commit removes it.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ovs-thread.c')
-rw-r--r-- | lib/ovs-thread.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c index b2d05a6cb..88b92d1d7 100644 --- a/lib/ovs-thread.c +++ b/lib/ovs-thread.c @@ -1,5 +1,5 @@ /* - * 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. @@ -332,7 +332,9 @@ ovsthread_wrapper(void *aux_) /* 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); |