Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!alberta!calgary!radford From: radford@calgary.UUCP Newsgroups: comp.arch Subject: Re: Available no. of registers Message-ID: <763@vaxb.calgary.UUCP> Date: Fri, 23-Jan-87 16:52:41 EST Article-I.D.: vaxb.763 Posted: Fri Jan 23 16:52:41 1987 Date-Received: Sat, 24-Jan-87 19:38:59 EST References: <3810002@nucsrl.UUCP> <926@mips.UUCP> <759@vaxb.calgary.UUCP> <1029@cuuxb.UUCP> Organization: U. of Calgary, Calgary, Ab. Lines: 32 Summary: Is C really THIS bad?! In article <1029@cuuxb.UUCP>, mwm@cuuxb.UUCP (Marc W. Mengel) writes: > Unfortunately, you don't have to take the address of a given variable > to use it, you merely have to take the address of a variable near it > and add an offset to it. The way C is defined, this is quite legal. > > For example, suppose I have a function f, declared as follows: > f(p) > struct { int a, b, c; } *p; > { > ... > } > And I call it as follows: > b() > { > int a, b, c; > > f( &a ); > } > According to our venerable friends kerningham&ritchie, this is legal; > it is also used to some great extent in the older (v6 & v7) unix kernels. I know C is poorly designed, but is it really THIS bad?! Did Kernighan and Ritchie suffer from this level of brain damage? Does anyone know? I assume the proposed ANSI standard doesn't countenance this sort of behaviour... Anyway, regardless of what old C manuals said, this is sufficiently ridiculous programming that compiler writers should ignore it and shoot any programmers who complain. Radford Neal