Path: utzoo!mnetor!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: typedef laxity Message-ID: <10308@steinmetz.ge.com> Date: 7 Apr 88 17:50:53 GMT References: <1070@maynard.BSW.COM> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 61 Keywords: typedef lint 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 */ The Xenix compiler will complain if you set the warning level higher than the default. I ran your code with -W3 and got a "strong type mismatch." I also use the -Zg option to produce my function prototypes for a "proto.h" file. Output follows (I *like* compilers which can give you a listing!). PAGE 1 04-07-88 12:48:07 Line# Source Line Xenix 8086/80286 C Compiler Release 2.00 1 typedef int TEMP; 2 typedef int PRES; 3 4 TEMP tx, ty; 5 PRES px, py; 6 7 main() { 8 ty = py; ***** x.c(8) : warning 50: strong type mis-match 9 px = py; 10 ty = (TEMP)py; 11 } ***** x.c(11) : warning 35: no return value Global Symbols Name Type Size Class Offset main. . . . . . . . . . . . . . near function *** global 0000 px. . . . . . . . . . . . . . . int 2 common *** py. . . . . . . . . . . . . . . int 2 common *** tx. . . . . . . . . . . . . . . int 2 common *** ty. . . . . . . . . . . . . . . int 2 common *** Code size = 0023 (35) Data size = 0000 (0) Bss size = 0000 (0) No errors detected -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me