[sheepdog] [PATCH 1/2] find double declaration of global variables in sparse check

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Feb 4 07:33:52 CET 2013


We do not initialise global variables to 0 or NULL and it allows GCC
to declare them multiple times in different places.  This detects the
unsafe usage when doing sparse check.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 53d18b9..c5b4080 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -69,7 +69,7 @@ rpm: clean
 	rpmbuild $(RPMBUILDOPTS) -ba $(SPEC)
 
 CGCC=cgcc
-CGCC_CFLAGS=-Wbitwise -Wno-return-void $(ARCH)
+CGCC_CFLAGS=-Wbitwise -Wno-return-void $(ARCH) -fno-common
 
 sparse-check: ARCH=$(shell sh script/checkarch.sh)
 sparse-check:
-- 
1.7.2.5




More information about the sheepdog mailing list