Path: utzoo!mnetor!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!ukma!uflorida!codas!cpsc6a!atl2!akgua!mtunx!whuts!picuxa!gp From: gp@picuxa.UUCP (Greg Pasquariello X1190) Newsgroups: comp.lang.c Subject: Re: typedef laxity Message-ID: <542@picuxa.UUCP> Date: 8 Apr 88 14:00:48 GMT References: <1070@maynard.BSW.COM> Reply-To: gp@picuxa.UUCP (Greg Pasquariello X1190) Organization: AT&T/EDS Product Integration Center Lines: 30 In article <1070@maynard.BSW.COM> campbell@maynard.BSW.COM (Larry Campbell) writes: >It seems to me someone should complain about this code: > > typedef int TEMPERATURE; > typedef int PRESSURE; > > TEMPERATURE tx, ty; > PRESSURE px, py; > > ty = py; /* type clash */ > >But none of the compilers I've tested (pcc, VAX-11 C, Wang VS C, Turbo C) >complain about it, and, even worse, _lint_ doesn't complain! The compiler does not complain about this, because it is not really a type clash. Typedef simply creates synonyms for a type. The compiler treats both "new types" the same as int. >Larry Campbell The Boston Software Works, Inc. Greg Pasquariello ihnp4!picuxa!gp