Path: utzoo!utgpu!attcan!uunet!husc6!ukma!rutgers!rochester!ritcv!moscom!jgp From: jgp@moscom.UUCP (Jim Prescott) Newsgroups: comp.lang.c Subject: Re: Portability of passing/operating on structures... Message-ID: <1288@moscom.UUCP> Date: 3 Nov 88 04:07:15 GMT References: <8810111934.AA21941@ucbarpa.Berkeley.EDU> <2685@hound.UUCP> Reply-To: jgp@moscom.UUCP (Jim Prescott) Organization: Moscom Corp., E. Rochester, NY Lines: 12 In article <2685@hound.UUCP> rkl1@hound.UUCP (K.LAUX) writes: > If you are trying to get the compiler to automatically generate code >to copy the fields of the structure, *don't*. What you can do is ... >a short loop to copy byte by byte based on 'sizeof (struct)'. Does ANSI guarantee that this would even work? I thought that attempting to read or write holes in structures was undefined (because they could actually be mapped out of your address space on some implementations). Thus anything that tried to look at all sizeof() bytes could fail. Is this correct? -- Jim Prescott moscom!jgp@cs.rochester.edu {rutgers,ames,harvard}!rochester!moscom!jgp