From: Andy Lester Date: Wed, 25 May 2005 12:31:39 +0000 (-0500) Subject: Updated lint infrastructure X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=075abff3feb0c6965ba49108266b27bec1bd4ae6;p=p5sagit%2Fp5-mst-13.2.git Updated lint infrastructure Message-ID: <20050525173139.GB1701@petdance.com> p4raw-id: //depot/perl@24580 --- diff --git a/Makefile.SH b/Makefile.SH index fce9ec6..1bbc7ef 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -354,7 +354,23 @@ obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS) -lintflags = -hbvxac +lintflags = \ + -bh \ + -p \ + -s \ + -Ncheck=%all \ + -Nlevel=4 \ + -errfmt=simple \ + -errtags \ + -erroff=E_BAD_PTR_CAST \ + -erroff=E_BLOCK_DECL_UNUSED \ + -erroff=E_CONSTANT_CONDITION \ + -erroff=E_BAD_PTR_CAST_ALIGN \ + -erroff=E_PTRDIFF_OVERFLOW \ + -erroff=E_EXPR_NULL_EFFECT \ + -erroff=E_BAD_PTR_INT_COMBINATION \ + -erroff=E_LOOP_EMPTY \ + *.c .c$(OBJ_EXT): $(CCCMD) $(PLDLFLAGS) $*.c @@ -1034,14 +1050,10 @@ _verycleaner: @$(LDLIBPTH) $(MAKE) _cleaner2 -rm -f *~ *.orig */*~ */*.orig */*/*~ */*/*.orig -# The following lint has practically everything turned on. Unfortunately, -# you have to wade through a lot of mumbo jumbo that can't be suppressed. -# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message -# for that spot. - .PHONY: lint lint: $(c) - lint $(lintflags) $(defs) perly.c $(c) > perl.fuzz + rm -f *.ln + lint $(lintflags) -DPERL_CORE -D_REENTRANT -DDEBUGGING -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(c) perly.c # Need to unset during recursion to go out of loop. # The README below ensures that the dependency list is never empty and @@ -1358,3 +1370,4 @@ esac ;; esac +# ex: set ts=8 sts=4 sw=4 noet: diff --git a/handy.h b/handy.h index 2aa02b7..067999a 100644 --- a/handy.h +++ b/handy.h @@ -519,11 +519,7 @@ Converts the specified character to lowercase. /* Line numbers are unsigned, 32 bits. */ typedef U32 line_t; -#ifdef lint -#define NOLINE ((line_t)0) -#else #define NOLINE ((line_t) 4294967295UL) -#endif /* @@ -598,8 +594,6 @@ hopefully catches attempts to access uninitialized memory. =cut */ -#ifndef lint - #define NEWSV(x,len) newSV(len) #ifdef PERL_MALLOC_WRAP @@ -646,23 +640,6 @@ hopefully catches attempts to access uninitialized memory. #define Poison(d,n,t) (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), 0xAB, (n) * sizeof(t))) -#else /* lint */ - -#define New(x,v,n,s) (v = Null(s *)) -#define Newc(x,v,n,s,c) (v = Null(s *)) -#define Newz(x,v,n,s) (v = Null(s *)) -#define Renew(v,n,s) (v = Null(s *)) -#define Move(s,d,n,t) -#define Copy(s,d,n,t) -#define Zero(d,n,t) -#define MoveD(s,d,n,t) d -#define CopyD(s,d,n,t) d -#define ZeroD(d,n,t) d -#define Poison(d,n,t) -#define Safefree(d) (d) = (d) - -#endif /* lint */ - #ifdef USE_STRUCT_COPY #define StructCopy(s,d,t) (*((t*)(d)) = *((t*)(s))) #else diff --git a/malloc.c b/malloc.c index affe763..3ed1689 100644 --- a/malloc.c +++ b/malloc.c @@ -271,19 +271,18 @@ # define LOG_OF_MIN_ARENA 14 #endif -#ifndef lint -# if defined(DEBUGGING) && !defined(NO_RCHECK) -# define RCHECK -# endif -# if defined(DEBUGGING) && !defined(NO_RCHECK) && !defined(NO_MFILL) && !defined(MALLOC_FILL) -# define MALLOC_FILL -# endif -# if defined(DEBUGGING) && !defined(NO_RCHECK) && !defined(NO_FILL_CHECK) && !defined(MALLOC_FILL_CHECK) -# define MALLOC_FILL_CHECK -# endif -# if defined(RCHECK) && defined(IGNORE_SMALL_BAD_FREE) -# undef IGNORE_SMALL_BAD_FREE -# endif +#if defined(DEBUGGING) && !defined(NO_RCHECK) +# define RCHECK +#endif +#if defined(DEBUGGING) && !defined(NO_RCHECK) && !defined(NO_MFILL) && !defined(MALLOC_FILL) +# define MALLOC_FILL +#endif +#if defined(DEBUGGING) && !defined(NO_RCHECK) && !defined(NO_FILL_CHECK) && !defined(MALLOC_FILL_CHECK) +# define MALLOC_FILL_CHECK +#endif +#if defined(RCHECK) && defined(IGNORE_SMALL_BAD_FREE) +# undef IGNORE_SMALL_BAD_FREE +#endif /* * malloc.c (Caltech) 2/21/82 * Chris Kingsley, kingsley@cit-20. @@ -2498,7 +2497,6 @@ Perl_dump_mstats(pTHX_ char *s) buffer.total_chain, buffer.sbrked_remains); #endif /* DEBUGGING_MSTATS */ } -#endif /* lint */ #ifdef USE_PERL_SBRK diff --git a/mg.c b/mg.c index f15dc26..05b9fc6 100644 --- a/mg.c +++ b/mg.c @@ -820,11 +820,9 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) sv_setsv(sv,&PL_sv_undef); break; case '.': -#ifndef lint if (GvIO(PL_last_in_gv)) { sv_setiv(sv, (IV)IoLINES(GvIOp(PL_last_in_gv))); } -#endif break; case '?': { @@ -852,7 +850,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) s = GvENAME(PL_defoutgv); sv_setpv(sv,s); break; -#ifndef lint case '=': if (GvIOp(PL_defoutgv)) sv_setiv(sv, (IV)IoPAGE_LEN(GvIOp(PL_defoutgv))); @@ -865,7 +862,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) if (GvIOp(PL_defoutgv)) sv_setiv(sv, (IV)IoPAGE(GvIOp(PL_defoutgv))); break; -#endif case ':': break; case '/': diff --git a/pp.c b/pp.c index f4d1163..2a543b3 100644 --- a/pp.c +++ b/pp.c @@ -4671,11 +4671,9 @@ PP(pp_split) } } else { -#ifndef lint while (s < strend && --limit && (m = fbm_instr((unsigned char*)s, (unsigned char*)strend, csv, multiline ? FBMrf_MULTILINE : 0)) ) -#endif { dstr = newSVpvn(s, m-s); if (make_mortal) diff --git a/regcomp.h b/regcomp.h index 35a144fb..6a2a22d 100644 --- a/regcomp.h +++ b/regcomp.h @@ -154,15 +154,9 @@ struct regnode_charclass_class { /* has [[:blah:]] classes */ #undef NEXT_OFF #undef NODE_ALIGN -#ifndef lint -# define NEXT_OFF(p) ((p)->next_off) -# define NODE_ALIGN(node) -# define NODE_ALIGN_FILL(node) ((node)->flags = 0xde) /* deadbeef */ -#else /* lint */ -# define NEXT_OFF(p) 0 -# define NODE_ALIGN(node) -# define NODE_ALIGN_FILL(node) -#endif /* lint */ +#define NEXT_OFF(p) ((p)->next_off) +#define NODE_ALIGN(node) +#define NODE_ALIGN_FILL(node) ((node)->flags = 0xde) /* deadbeef */ #define SIZE_ALIGN NODE_ALIGN @@ -309,15 +303,11 @@ struct regnode_charclass_class { /* has [[:blah:]] classes */ /* * Utility definitions. */ -#ifndef lint #ifndef CHARMASK -#define UCHARAT(p) ((int)*(const U8*)(p)) +# define UCHARAT(p) ((int)*(const U8*)(p)) #else -#define UCHARAT(p) ((int)*(p)&CHARMASK) +# define UCHARAT(p) ((int)*(p)&CHARMASK) #endif -#else /* lint */ -#define UCHARAT(p) PL_regdummy -#endif /* lint */ #define EXTRA_SIZE(guy) ((sizeof(guy)-1)/sizeof(struct regnode))