This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: structure members of packed structures
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, <gcc at gcc dot gnu dot org>
- Date: Tue, 15 Jul 2003 00:14:51 -0400 (EDT)
- Subject: Re: structure members of packed structures
On 14 Jul 2003, Mark Mitchell wrote:
> > and only when used in an expression whose type also
> > doesn't include a packed qualifier. For example, this should
> > remain valid and supported:
> >
> > struct Packed s1;
> > struct __attribute__ ((packed)) Unpacked *p1;
> > p1 = &s1.u;
>
> This makes sense too, but it is hard to implement what Nathan suggests
> together with what you suggest.
If it's not possible, then that's an important NEWS item.
> Nathan, can we just prevent the assignment? What if
> comp_type_attributes checked for a mismatch here?
Not sure if you meant to restrict what I pointed out. I didn't
mean only assigment, but general expressions, e.g.
typedef struct __attribute__ ((packed)) Unpacked Pu;
void f (Pu *);
f (&s1.u);
brgds, H-P