X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/0f4556f12c8f75078501c9d1338ae7648a97f975..95f51977ddc18faa2e212f30c00a39540b39f325:/usr/src/usr.bin/lint/lint.c diff --git a/usr/src/usr.bin/lint/lint.c b/usr/src/usr.bin/lint/lint.c index 51e2b4728a..98af629ea2 100644 --- a/usr/src/usr.bin/lint/lint.c +++ b/usr/src/usr.bin/lint/lint.c @@ -1,10 +1,10 @@ #ifndef lint -static char sccsid[] = "@(#)lint.c 1.5 (Berkeley) 3/30/83"; +static char sccsid[] = "@(#)lint.c 1.10 (Berkeley) 3/20/86"; #endif lint -# include "mfile1" +# include "pass1.h" -# include "lmanifest" +# include "lmanifest.h" # include @@ -283,7 +283,7 @@ lpta( p ) NODE *p; { t.extra = (p->in.op==ICON); t.extra1 = 0; - if( !astype( &t, p->in.csiz ) ) { + if( !astype( &t, p->fn.csiz ) ) { switch( t.aty ){ case CHAR: @@ -651,6 +651,7 @@ clocal(p) NODE *p; { register o; register unsigned t, tl; + int s; switch( o = p->in.op ){ @@ -662,7 +663,7 @@ clocal(p) NODE *p; { /* assume conversion takes place; type is inherited */ t = p->in.type; tl = p->in.left->in.type; - if( aflag && (tl==LONG||tl==ULONG) && (t!=LONG&&t!=ULONG) ){ + if( aflag && (tl==LONG||tl==ULONG) && (t!=LONG&&t!=ULONG&&t!=UNDEF) ){ werror( "long assignment may lose accuracy" ); } if( aflag>=2 && (tl!=LONG&&tl!=ULONG) && (t==LONG||t==ULONG) && p->in.left->in.op != ICON ){ @@ -698,6 +699,20 @@ clocal(p) NODE *p; { p->in.op = FREE; return( buildtree( o==PMCONV?MUL:DIV, p->in.left, p->in.right ) ); + case RS: + case LS: + case ASG RS: + case ASG LS: + if( p->in.right->in.op != ICON ) + break; + s = p->in.right->tn.lval; + if( s < 0 ) + werror( "negative shift" ); + else + if( s >= dimtab[ p->fn.csiz ] ) + werror( "shift greater than size of object" ); + break; + } return(p); @@ -780,10 +795,11 @@ fsave( s ) char *s; { static union rec fsname; s = strip( s ); #ifndef FLEXNAMES - if( strncmp( s, fsname.f.fn, LFNM ) ){ + if( strncmp( s, fsname.f.fn, LFNM ) ) #else - if (fsname.f.fn == NULL || strcmp(s, fsname.f.fn)) { + if (fsname.f.fn == NULL || strcmp(s, fsname.f.fn)) #endif + { /* new one */ #ifndef FLEXNAMES strncpy( fsname.f.fn, s, LFNM ); @@ -949,7 +965,7 @@ isitfloat ( s ) char *s; { /* lint version */ dcon = atof( s ); - return( FCON ); + return( DCON ); } fldcon( p ) register NODE *p; {