Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!ll-xn!mit-eddie!uw-beaver!cornell!rochester!PT.CS.CMU.EDU!andrew.cmu.edu!bader+ From: bader+@andrew.cmu.edu (Miles Bader) Newsgroups: comp.arch Subject: Re: RISC data alignment Message-ID: Date: 18 Feb 88 16:51:52 GMT References: <2635@calmasd.GE.COM> <28200092@ccvaxa> <496@ecrcvax.UUCP>, <3001@bloom-beacon.MIT.EDU> Organization: Carnegie Mellon University Lines: 17 In-Reply-To: <3001@bloom-beacon.MIT.EDU> jfc@athena.mit.edu (John F Carr) writes: > Isn't code which depends on allignment and spacing risky anyway? > If a program assumes that for > > struct { int a; > int b; > } s; > > (&(s.a) - &(s.b)) == 1 it is making an unsupported assumption. Can > someone post an example of a program which is portable and depends on > the K&R rule quoted above? The common case is that of extending the last element of a structure... Does anyone have code that will break if the elements are ordered arbitrarily, BUT the last element is kept last? -Miles