On Mon, 15 Jul 2002, Terry Lambert wrote:
> Thomas Moestl wrote:
> > > He's making the valid point that for:
> > >
> > >       struct foo *fee;
> > >
> > > It's possible that:
> > >
> > >       sizeof(struct foo) != (((char *)&fee[1]) - ((char *)&fee[0]))
> > 
> > No, I do not. In fact, the opposite:
> > 
> >         sizeof(struct foo) = (((char *)&fee[1]) - ((char *)&fee[0]))
> > 
> > _must_ always be true

> Reread my second to last paragraph.  I'm saying the same thing
> that you are.  


How can you possibly be saying the same thing, when you are saying the
exact opposite (You: A != B may be true, Thomas: A == B must be true)?

You're saying:

sizeof(struct foo) != (((char *)&fee[1]) - ((char *)&fee[0]))

which would imply that end-padding is not included in sizeof(struct foo),
when it must be, otherwise malloc(n * sizeof(struct foo)) would not
allocate enough memory for an array of n elements of struct foo.

-- 
David Taylor
[EMAIL PROTECTED]
"The future just ain't what it used to be"

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to