This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: testsuite issue
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: JBeulich at novell dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 7 Dec 2005 17:54:42 +0100
- Subject: Re: testsuite issue
> Date: Wed, 07 Dec 2005 09:18:53 +0100
> From: "Jan Beulich" <JBeulich@novell.com>
Just for the record (in case someone else has the same thoughts)
and because I'd already written most of the reply, I also
replied to your first email. See last for your follow-up.
> What has the alignment of type 'long long' to do with structure
> packing?
Only the obvious(?): if long long is usually padded in a
structure, then marking it with attribute-packed has effect.
IIUC for netware, you pack everything in structures *except*
long long, which you pad to 32-bit alignment. Right? If not,
then the warning emission machinery is wrong.
> Structure packing is exactly to override the alignment of the
> type. And in the given situation, alignment of 'long long' is at least
> 32 (bits), whereas BITS_PER_UNIT is 8, and hence the attribute is really
> not ignored (because the alignment gets overridden in order to pack the
> field), hence the expectation of a warning here seems wrong. If not, can
> you explain what it is that makes you expect a warning here?
If "long long" is packed by default then a target default_packed
*should* get the "is ignored" warning. On the other hand, if
the warning is considered correct as emitted, you need to write
something like a default_packed_except_long_long testsuite
thingy and use that here. See default_packed bits.
And later:
>It should not only check TYPE_ALIGN (), but also consider current
>structure packing in effect (and consequently, it should also be emitted
>e.g. when #pragma pack(1) is in effect on a target that doesn't default
>to packed structures).
Agreed. I'd be happy to see this.
brgds, H-P