Re: C structure padding

drw@phragmen.mit.edu (Dale R. Worley)
Mon, 28 Jun 1993 16:03:19 GMT

          From comp.compilers

Related articles
Permuting fields of records garavel@imag.fr (1993-06-04)
C structure padding drw@zermelo.mit.edu (1993-06-26)
Re: C structure padding pat@tesuji.qc.ca (1993-06-27)
Re: C structure padding lord+@andrew.cmu.edu (Tom Lord) (1993-06-27)
Re: C structure padding jqb@netcom.com (1993-06-27)
Re: C structure padding drw@phragmen.mit.edu (1993-06-28)
Re: C structure padding jqb@netcom.com (1993-06-28)
Re: C structure padding msb@sq.sq.com (1993-06-29)
| List of all articles for this month |
Newsgroups: comp.compilers
From: drw@phragmen.mit.edu (Dale R. Worley)
Keywords: C, comment
Organization: MIT Dept. of Tetrapilotomy, Cambridge, MA, USA
References: 93-06-012 93-06-066
Date: Mon, 28 Jun 1993 16:03:19 GMT

I will point out that all the discussions of "why structs have to always
have padding in them" refer to the use of memcpy, bcopy, or some such
routine -- "Otherwise bcopy of the structure would affect something else."


But is there a clear statement that if you bcopy over a struct, with a
length of sizeof(the struct), that you won't affect some other object?
Obviously, you don't want it to, but does the Standard actually *say* that
anywhere?


Dale


Dale Worley Dept. of Math., MIT drw@math.mit.edu
[It says so indirectly -- routines like memcpy() take a length argument which
is a size_t, and the only portable way to get a size-t is with sizeof. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.