Article View: net.lang.c
Article #9445Lint (was Re: enum function bug?)
From: Spencer W. Thomas
Date: Wed, 01 Oct 1986 17:53
Date: Wed, 01 Oct 1986 17:53
45 lines
1266 bytes
1266 bytes
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@utah-cs.ARPA)
Technical Details
Message-ID:
<1815@utah-gr.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!utah-cs!utah-gr!thomasReferences:
<299@sdchema.sdchem.UUCP> <86900054@haddock> <572@opus.nbires.UUCP> <226@BMS-AT.UUCP> <3635@umcp-cs.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!utah-cs!utah-gr!thomas From: thomas@utah-gr.UUCP (Spencer W. Thomas) Newsgroups: net.lang.c Subject: Lint (was Re: enum function bug?) Message-ID: <1815@utah-gr.UUCP> Date: Wed, 1-Oct-86 13:53:34 EDT Article-I.D.: utah-gr.1815 Posted: Wed Oct 1 13:53:34 1986 Date-Received: Fri, 3-Oct-86 00:51:39 EDT References: <299@sdchema.sdchem.UUCP> <86900054@haddock> <572@opus.nbires.UUCP> <226@BMS-AT.UUCP> <3635@umcp-cs.UUCP> Reply-To: thomas@utah-gr.UUCP (Spencer W. Thomas) Organization: University of Utah CS Dept Lines: 45