Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704A-Liber) Newsgroups: comp.lang.c Subject: Re: what C needs -- packed structures Message-ID: <3314@ihlpf.ATT.COM> Date: 9 Jan 88 01:16:23 GMT References: <8801071842.AA04669@decwrl.dec.com> Reply-To: nevin1@ihlpf.UUCP (00704A-Liber,N.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 26 In article <8801071842.AA04669@decwrl.dec.com> devine@cookie.dec.com (Bob Devine) writes: .Path: decwrl!labrea!rutgers!cmcl2!brl-adm!brl-smoke!gwyn .Subject: Re: what C needs . .I wrote: ..When writing code that requires control of alignment or location, .. [...I want a way to pack a structure] . . A different argument for providing packed/unpacked structures is .simply to allow the programmer to choose between access speed or .smaller data segment. As an example of prior art, Microsoft C has .a compile time flag for this. Granted, not all structures would .be packed the same way or even could be packed. Some architectures .allow ints to be only integer aligned (pyramid, I believe) while .others all ints to be char aligned (vax). . . Consider this suggestion in light of the C philosophy or letting .the programmer decide. I do not believe that this should be implemented as a feature of the language; This is best left to defining library routines for packing/unpacking data. -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_