Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: Un-alignment in structures Message-ID: <5399@utzoo.UUCP> Date: Tue, 2-Apr-85 13:03:17 EST Article-I.D.: utzoo.5399 Posted: Tue Apr 2 13:03:17 1985 Date-Received: Tue, 2-Apr-85 13:03:17 EST References: <230@tellab2.UUCP>, <135@mit-athena.UUCP> Organization: U of Toronto Zoology Lines: 21 > Even on machines that "can't do" unaligned integers, this program > will probably run without "error" and will give some garbage for > output. The point is that C programs can stuff any value whatsoever > into pointers. After all, what's to stop them? Unless you violate > hardware bounds, you will usually get something. At worst, the > low-order bits will be ignored, and you'll get one of the "adjacent" > aligned words. Wrong. On most machines that don't support unaligned integers, you will get a signal and a core dump. > ...After all, what does it gain a man > to save a millisecond of his computer's time if he loses an hour > of his own time thereby? Sometimes it saves his successor from spending many hours figuring out how to get that millisecond out. Yes, Virginia, some programs do have to run fast, and few are the worse for a speed improvement. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry