Jan Beulich wrote:
I don't think this is the case. The questionable code (from the test
case) really is
struct Unpacked { int i; };
struct __attribute__ ((packed)) Packed
{
char c;
int i;
Unpacked u;
};
and the test expects that you cannot bind Packed::u to Unpacked& (error
expected), b
>It can be made to work by not packing Baz::m, and that is what g++ does
(with a
>warning%). Issuing an error in this case I don't think is acceptable
-- I know
>of users who would complain. If the user explicitly packed Baz::m
field, rather
>than the containing structure, I would be happy wit
Nathan Sidwell wrote:
> Mark Mitchell wrote:
>
>> struct Foo { void operator=(Foo const &);};
>> struct Baz __attribute__((packed))
>> {
>>char c;
>>Foo m;
>> }
>>
>> void Bar (Baz *ptr)
>> {
>>ptr->m = something;
>> }
>>
>> I'm not sure it can be made to work, without making th
Mark Mitchell wrote:
struct Foo { void operator=(Foo const &);};
struct Baz __attribute__((packed))
{
char c;
Foo m;
}
void Bar (Baz *ptr)
{
ptr->m = something;
}
I'm not sure it can be made to work, without making the base class
version of Foo::operator= expect unaligned input
Nathan Sidwell wrote:
> Jan Beulich wrote:
>
>>
>> Why? It's broken. You just cannot embed something that requires
>> alignment into something that doesn't guarantee alignment, except that
>> for built-in types, the compiler can synthesize the necessary splitting,
>> but Foo's assignment operator,
Jan Beulich wrote:
Why? It's broken. You just cannot embed something that requires
alignment into something that doesn't guarantee alignment, except that
for built-in types, the compiler can synthesize the necessary splitting,
but Foo's assignment operator, in your example, may be totally unawa
>>> Nathan Sidwell <[EMAIL PROTECTED]> 07.12.05 17:22:10 >>>
>Jan Beulich wrote:
>
>> And that is precisely the reason why I think binding a reference to
the
>> whole object or any of its members, when the object itself is a
member
>> of a packed object, is illegal, hence requiring a diagnostic
(un
Jan Beulich wrote:
And that is precisely the reason why I think binding a reference to the
whole object or any of its members, when the object itself is a member
of a packed object, is illegal, hence requiring a diagnostic (unless,
like for both other cases, the default is to pack structures).
>>> Nathan Sidwell <[EMAIL PROTECTED]> 07.12.05 16:58:11 >>>
>Jan Beulich wrote:
>> This test contains three invocations of Ref(), but only two of them
are
>> considered ill. What I'd like to get an explanation for is why the
third
>> (middle) instance is considered correct. After all, the u member
Jan Beulich wrote:
This test contains three invocations of Ref(), but only two of them are
considered ill. What I'd like to get an explanation for is why the third
(middle) instance is considered correct. After all, the u member of
Packed is packed, and hence all the members of Unpacked in that c
This test contains three invocations of Ref(), but only two of them are
considered ill. What I'd like to get an explanation for is why the third
(middle) instance is considered correct. After all, the u member of
Packed is packed, and hence all the members of Unpacked in that context
are, too. Name
11 matches
Mail list logo