Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: Type checking: shouldn't lint/cc complain? Message-ID: <4454@utzoo.UUCP> Date: Sat, 13-Oct-84 19:33:19 EDT Article-I.D.: utzoo.4454 Posted: Sat Oct 13 19:33:19 1984 Date-Received: Sat, 13-Oct-84 19:33:19 EDT References: <5344@yale.ARPA> Organization: U of Toronto Zoology Lines: 21 > typedef int FOO ; > typedef int BAR ; > > #define XXX (FOO) 1 > > ... > > BAR fff ; > > fff = XXX ; > > When I run lint or cc on this program (on 4.1BSD or 4.2BSD), I > get no complaints about the fact that fff is a variable of type > BAR and it is being assigned a value of type FOO. ... If you look at the specs of typedef, it's explicitly defined to be purely an abbreviation mechanism, with no effect on type matching. So this is legal C. It *would* be nice if lint would complain... -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry