From: Alex Wang Date: Tue, 20 Aug 2013 22:24:19 +0000 (-0700) Subject: sparse: Suppress sparse warnings for global variables. X-Git-Tag: sliver-openvswitch-2.0.90-1~20^2~28 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3f659b53262c07b47ed7b2e9d26ef94d1071b487;p=sliver-openvswitch.git sparse: Suppress sparse warnings for global variables. sparse warns if a non-static variable with external linkage has an initializer at first declaration. This commit suppresses the warnings issued when adding custom section is not supported by compiler. Signed-off-by: Alex Wang Signed-off-by: Ben Pfaff --- diff --git a/lib/coverage.c b/lib/coverage.c index 82ce85b8e..23e29973d 100644 --- a/lib/coverage.c +++ b/lib/coverage.c @@ -46,11 +46,13 @@ extern struct coverage_counter *__stop_coverage[]; *countp = 0; \ return count; \ } \ + extern struct coverage_counter counter_##COUNTER; \ struct coverage_counter counter_##COUNTER \ = { #COUNTER, COUNTER##_count, 0 }; #include "coverage.def" #undef COVERAGE_COUNTER +extern struct coverage_counter *coverage_counters[]; struct coverage_counter *coverage_counters[] = { #define COVERAGE_COUNTER(NAME) &counter_##NAME, #include "coverage.def" diff --git a/lib/vlog.c b/lib/vlog.c index 061250a3e..a2671121f 100644 --- a/lib/vlog.c +++ b/lib/vlog.c @@ -74,6 +74,7 @@ extern struct vlog_module *__stop_vlog_modules[]; #include "vlog-modules.def" #undef VLOG_MODULE +extern struct vlog_module *vlog_modules[]; struct vlog_module *vlog_modules[] = { #define VLOG_MODULE(NAME) &VLM_##NAME, #include "vlog-modules.def"