Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mephisto!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!rex!ames!dftsrv!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Structures Message-ID: <22953@mimsy.umd.edu> Date: 7 Mar 90 09:42:12 GMT References: <14302@reed.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 29 In article meissner@osf.org (Michael Meissner) writes: >ANSI requires that implementations be able to pass structures by >value, return them, and assigning structures. Note that the maximum >size of a structure that you can pass is implementation defined. For >example, unless they've changed the calling sequence recently, on a >VAX, the size of all of the arguments must be less than 512 longwords >(or bytes, I don't use vaxen). This is true but misleading: the VAX can easily pass more than 255 longwords, but when it does so, the magic `pop this many longwords' count (for the `ret' instruction) will be incorrect and the compiler must compensate for this. Some (non C) routines may also get confused as to how many arguments were given. >>[why did K&R-1 C not have structure valued arguments?] >Possibly because the PDP11 did not have a block move instruction, or >possibly Dennis Ritchie hadn't gotten around to it when K&R-I was >written. The latter seems the most likely explanation. Things were added to the orignal PDP-11 C compiler as they became useful; structure-valued arguments were not often wanted. This same C compiler did not have a `long' data type in Version 6, for instance. Fortunately, K&R 1st edition was written after the `long' type was added. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris