Path: utzoo!utgpu!water!watmath!clyde!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: typedef laxity Message-ID: <3415@haddock.ISC.COM> Date: 12 Apr 88 03:38:10 GMT References: <1070@maynard.BSW.COM> <542@picuxa.UUCP> <1071@maynard.BSW.COM> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 23 In article <1071@maynard.BSW.COM> campbell@maynard.UUCP (Larry Campbell) writes: >>Typedef simply creates synonyms for a type. > >[I know, but] I am arguing that how it works is a _bad thing_. I would like >lint, at least, to complain. Can anyone convince me that it shouldn't? Okay, let's pretend we have such strictness. typedef int foo_t; typedef int bar_t; foo_t f1, f2; bar_t b1; int i; Now, which of the following expressions should be legal, and what should be their types? -f1 f1 + 1 f1 - f2 f1 * 5 f1 / f2 f1 + b1 f1 * b1 f1 = i i = f1 f1 = b1 I'm not saying that dimensional analysis shouldn't be done, just that it's not trivial to define the rules. In fact I have a partially-written essay on this, which I might post someday... Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint