summaryrefslogtreecommitdiff
path: root/lib/vlog.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-05-06 11:38:19 -0700
committerBen Pfaff <blp@nicira.com>2011-05-16 13:40:48 -0700
commitf4070db7e5ae7727876d6cc318fba10033dc2c85 (patch)
tree79f11ffa1f4f5987b557ac23b858a77a195a3b60 /lib/vlog.h
parent2932bd0512422ca9540a9a99c57c3a7f60d22df0 (diff)
downloadopenvswitch-f4070db7e5ae7727876d6cc318fba10033dc2c85.tar.gz
Suppress sparse warnings for global variables initialized in headers.
sparse warns if a non-static variable with external linkage has an initializer at first declaration, because it suspects that it should be static instead. Generally it's correct, but not in these cases, so add a redundant declaration to suppress the warning. The suppress warnings look like: ../ofproto/connmgr.c:40:1: warning: symbol 'VLM_connmgr' was not declared. Should it be static? ../ofproto/collectors.c:31:1: warning: symbol 'vlog_module_ptr_collectors' was not declared. Should it be static? ../ofproto/connmgr.c:43:1: warning: symbol 'counter_ofconn_stuck' was not declared. Should it be static?
Diffstat (limited to 'lib/vlog.h')
-rw-r--r--lib/vlog.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/vlog.h b/lib/vlog.h
index 12844c6f7..3f40c297d 100644
--- a/lib/vlog.h
+++ b/lib/vlog.h
@@ -92,6 +92,7 @@ struct vlog_module {
#if USE_LINKER_SECTIONS
#define VLOG_DEFINE_MODULE(MODULE) \
VLOG_DEFINE_MODULE__(MODULE) \
+ extern struct vlog_module *vlog_module_ptr_##MODULE; \
struct vlog_module *vlog_module_ptr_##MODULE \
__attribute__((section("vlog_modules"))) = &VLM_##MODULE
#else
@@ -258,6 +259,7 @@ void vlog_usage(void);
} while (0)
#define VLOG_DEFINE_MODULE__(MODULE) \
+ extern struct vlog_module VLM_##MODULE; \
struct vlog_module VLM_##MODULE = \
{ \
#MODULE, /* name */ \