This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]