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

Liu Yuan namei.unix at gmail.com
Mon Feb 4 08:13:21 CET 2013


On 02/04/2013 02:33 PM, MORITA Kazutaka wrote:
> 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:
> 

By the way, how to use splint with sheepdog? I noticed that we have
lint:xxx in each directory's Makefile.am, but I can't 'make lint'. If
splint is no longer working, how about adding a command like 'make
sparse' or 'make check' to do the sparse check against source files?

Thanks,
Yuan



More information about the sheepdog mailing list