Path: utzoo!attcan!uunet!mcsun!ukc!icdoc!sot-ecs!cwj From: cwj@ecs.soton.ac.uk (Chris Johnson) Newsgroups: comp.arch Subject: Re: structures (was RISC Machine Data Structure Word Alignment Problems) Message-ID: <2322@ecs.soton.ac.uk> Date: 1 Feb 90 12:28:24 GMT References: <1810@sunquest.UUCP> <22197@mimsy.umd.edu> Organization: University of Southampton, UK Lines: 37 chris@mimsy.umd.edu (Chris Torek) writes: >In article <1810@sunquest.UUCP> terry@sunquest.UUCP (Terry Friedrichsen) >writes: >>Borrow Pascal's idea of "records" and "packed records". ... >This does not really cover all the possibilities. I think these >attributes do: > A. unordered structures: the compiler may rearrange these ... > B. packed unordered structures: the compiler may rearrange these... > C. external (packed and ordered) structures: the compiler may ... In general this should be specified by the programmer, not restricted to a few possibilities that may exclude some cases. We are dealing with two aspects of the data: logical structure (component names for creation and retrieval functions), and storage mapping. >(I would redirect this to comp.lang.c, but it does not really belong >there either.) This IS a language issue, as can be seen by considering Ada for a moment, rather than C: in Ada the representation/implementation mapping properties can be specified cleanly, separately from the type declarations, by using an unadorned structured type (record, array...) declaration and a separate but associated Representation Clause. Representations can specify exact bitfield placements for data within a program. Sure, the compiler has to do more work in translation, but alignment properties are fully under the programmer's control and the logic of the program remains portable (take away the representation cluase and the program should still work on another machine, albeit with some wasted space for default alignments and component ordering). The problem of trasmitting data between processors still exists, but that's a different area... see Lamb's IDL system software for instance.