Lint (was Re: enum function bug?)

Spencer W. Thomas thomas at utah-gr.UUCP
Thu Oct 2 03:53:34 AEST 1986


I once looked at the innards of our (4.2) lint, and concluded that it
does type matching on structure data types by comparing
	1. Length of the data item
	2. A hash of the data item's type name.

Thus, we have:

================ x.c ================
struct s
{
    char i[4];
};

struct s
func()
{
    struct a;

    a.i[0] = 'a';
    return a;
}

================ y.c ================
struct s
{
    long a;
};

main()
{
    struct s b, func();

    b = func();
    return 0;
}


Running 'lint x.c y.c' gives (!)

x.c:
y.c:

-- 
=Spencer   ({ihnp4,decvax}!utah-cs!thomas, thomas at utah-cs.ARPA)



More information about the Comp.lang.c mailing list