This is the mail archive of the
mailing list for the GCC project.
Re: PR 6212
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: mark at codesourcery dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 8 May 02 07:00:22 EDT
- Subject: Re: PR 6212
> 3 bytes long and byte-aligned, I can make an object that's 4-byte-aligned
> (and hence 4 bytes long). If I make a pointer to that object, that's a
> pointer to a 3-byte type, not a 4-byte type. I don't see how you can do
No, it's a pointer to a 4-byte type.
I disagree. It's a pointer to a 3-byte type, but a 4-byte *object*.
> Moreover, what do you do about bitfields? Do we now have types with
> sizes that are not multiples of bytes?
Bitfields, at least in C, are not addressable, so this doesn't matter.
The only thing you can do with a bitfield lvalue is write to it, and
then you know just where you're writing. Reading from it yields a
promotion to the appropriate integer type.
But if you eliminate DECL_SIZE, how to you know the size of a bitfield?
The issue is why make different types in just some cases, since we know we
can't for bitfields.