utah rcsid 3.4 86/03/12 15:19:04: Pass debugging flags on to mainp1();
authorDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 12 Dec 1987 11:23:43 +0000 (03:23 -0800)
committerDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 12 Dec 1987 11:23:43 +0000 (03:23 -0800)
fix braces for ctags.
utah rcsid 3.5 87/07/06 17:30:16: Treat an occurrence of '&i' in a static or
external initialization as a set and a use of 'i'.
utah rcsid 3.7 87/07/10 22:25:02: Remove my old cinit() hack -- ado's hack
was better.  In turn, we can remove ado's lprt() hack, since a hack in
cgram.y can do better.
utah rcsid 3.8 87/07/15 20:49:38: Fixes for VARARGS0 -- check vaflag == 0,

SCCS-vsn: old/pcc/lint/lpass1/lint.c 1.13

usr/src/old/pcc/lint/lpass1/lint.c

index cce1392..33bcfc3 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)lint.c     1.12    (Berkeley)      %G%";
+static char sccsid[] = "@(#)lint.c     1.13    (Berkeley)      %G%";
 #endif lint
 
 # include "pass1.h"
 #endif lint
 
 # include "pass1.h"
@@ -223,13 +223,13 @@ bfcode( a, n ) int a[]; {
        if( Cflag && cfp->sclass == STATIC ) return;
 
        /* if variable number of arguments, only print the ones which will be checked */
        if( Cflag && cfp->sclass == STATIC ) return;
 
        /* if variable number of arguments, only print the ones which will be checked */
-       if( vaflag > 0 ){
+       if( vaflag >= 0 ){
                if( n < vaflag ) werror( "declare the VARARGS arguments you want checked!" );
                else n = vaflag;
                }
        fsave( ftitle );
                if( n < vaflag ) werror( "declare the VARARGS arguments you want checked!" );
                else n = vaflag;
                }
        fsave( ftitle );
-       if( cfp->sclass == STATIC ) outdef( cfp, LST, vaflag>=0?-n:n );
-       else outdef( cfp, libflag?LIB:LDI, vaflag>=0?-n:n );
+       if( cfp->sclass == STATIC ) outdef( cfp, LST, vaflag>=0?~n:n );
+       else outdef( cfp, libflag?LIB:LDI, vaflag>=0?~n:n );
        vaflag = -1;
 
        /* output the arguments */
        vaflag = -1;
 
        /* output the arguments */
@@ -465,8 +465,6 @@ lprt( p, down, uses ) register NODE *p; {
                        if( uses & VALSET ) q->sflags |= SSET;
                        if( uses & VALUSED ) q->sflags |= SREF;
                        if( uses & VALADDR ) q->sflags |= (SREF|SSET);
                        if( uses & VALSET ) q->sflags |= SSET;
                        if( uses & VALUSED ) q->sflags |= SREF;
                        if( uses & VALADDR ) q->sflags |= (SREF|SSET);
-                       if (uses & (VALSET | VALADDR))
-                               q->suse = -lineno;
                        if( p->tn.lval == 0 ){
                                lnp->lid = id;
                                lnp->flgs = (uses&VALADDR)?0:((uses&VALSET)?VALSET:VALUSED);
                        if( p->tn.lval == 0 ){
                                lnp->lid = id;
                                lnp->flgs = (uses&VALADDR)?0:((uses&VALSET)?VALSET:VALUSED);
@@ -751,6 +749,8 @@ noinit(){
 
 
 cinit( p, sz ) NODE *p; { /* initialize p into size sz */
 
 
 cinit( p, sz ) NODE *p; { /* initialize p into size sz */
+       register int id;
+
        inoff += sz;
        if( p->in.op == INIT ){
                if( p->in.left->in.op == ICON ) return;
        inoff += sz;
        if( p->in.op == INIT ){
                if( p->in.left->in.op == ICON ) return;
@@ -1302,7 +1302,7 @@ main(argc, argv)
        extern int      optind;
        int     ch;
 
        extern int      optind;
        int     ch;
 
-       while ((ch = getopt(argc,argv,"C:D:I:U:LPabchnpuvxz")) != EOF)
+       while ((ch = getopt(argc,argv,"C:D:I:U:LX:Pabchnpuvxz")) != EOF)
                switch((char)ch) {
                        case 'C':
                                Cflag = 1;
                switch((char)ch) {
                        case 'C':
                                Cflag = 1;
@@ -1311,6 +1311,7 @@ main(argc, argv)
                        case 'D':       /* #define */
                        case 'I':       /* include path */
                        case 'U':       /* #undef */
                        case 'D':       /* #define */
                        case 'I':       /* include path */
                        case 'U':       /* #undef */
+                       case 'X':       /* debugging, done in first pass */
                        case 'P':       /* debugging, done in second pass */
                                break;
                        case 'L':
                        case 'P':       /* debugging, done in second pass */
                                break;
                        case 'L':