[comp.lang.c] possible lint bug

pase@ogcvax.UUCP (Douglas M. Pase) (08/13/87)

I have posted this article before, but as far as I can tell it never left
our machine.  So, I apologize if you have seen it before.

I am having some trouble with lint.  It seems the problem is that lint
considers structures of the same size to be the same structures, even when
they are not.  We are using Unix 4.3BSD on a VAX, and I am unable to determine
the exact version of lint being used.

In the example below, I experimented with several different sizes for the
structures `s_A' and `s_B', and lint proclaimed the argument usage
to be inconsistent whenever the sizes were different.  It failed to mention any
inconsistency whenever the sizes were the same, even when it was because of
padding in the field allocation to allign pointers (doubles, floats, whatever)
on certain boundaries (e.g. allocating 4 bytes for a `short').

Question:  Is this considered a "bug" or a "feature"?  If it's a bug, is there
a fix?  If it's a "feature", someone should be shot!

Script started on Fri Jul 31 17:15:13 1987
[101] num lint4.c
     1  struct s_A {
     2          char a;
     3  };
     4  
     5  struct s_B {
     6          char b;
     7  };
     8  
     9  r1(x)
    10  struct s_B *x;
    11  {
    12          if (r2(x))
    13                  ;
    14  }
    15  
    16  r2(y)
    17  struct s_A *y;
    18  {
    19          return(y->a == 0);
    20  }
[102] lint lint4.c
lint4.c:
r1 defined( lint4.c(11) ), but never used
[103] exit
script done on Fri Jul 31 17:17:17 1987

--
Doug Pase   --   ...ucbvax!tektronix!ogcvax!pase  or  pase@Oregon-Grad.csnet