Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site turtlevax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!dual!amd!turtlevax!ken From: ken@turtlevax.UUCP (Ken Turkowski) Newsgroups: net.lang.c Subject: Re: Type checking: shouldn't lint/cc complain? Message-ID: <559@turtlevax.UUCP> Date: Sun, 14-Oct-84 21:11:36 EDT Article-I.D.: turtleva.559 Posted: Sun Oct 14 21:11:36 1984 Date-Received: Tue, 16-Oct-84 05:29:39 EDT References: <5344@yale.ARPA> Distribution: net Organization: CADLINC, Inc. @ Palo Alto, CA Lines: 23 > Let's say I have the following C program: > > typedef int FOO ; > typedef int BAR ; > #define XXX (FOO) 1 > main() { > 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. Now I wouldn't > want the C compiler to crap out on this code (as Pascal probably > would with the equivalent program), but shouldn't the compiler > (or at least lint) complain about this? I agree that the compiler or lint should complain. Otherwise there's no advantage to using a typedef over a #define. -- Ken Turkowski @ CADLINC, Palo Alto, CA UUCP: {amd,decwrl,flairvax,nsc}!turtlevax!ken ARPA: turtlevax!ken@DECWRL.ARPA