[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 09:32:39 CET 2013


At Mon, 04 Feb 2013 15:13:21 +0800,
Liu Yuan wrote:
> 
> 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

I've tested 'make lint' but don't manage to make splint check sheepdog
codes.  Looks okay to remove it.

> splint is no longer working, how about adding a command like 'make
> sparse' or 'make check' to do the sparse check against source files?

'make check' looks good to me.  I'll send the patch in another mail.

Thanks,

Kazutaka



More information about the sheepdog mailing list