Strict aliasing and chains revisited

Chris Johns chrisj at rtems.org
Tue Oct 26 05:15:12 UTC 2010


On 25/10/10 6:19 AM, Till Straumann wrote:
> On 10/25/2010 12:38 AM, Sebastian Huber wrote:
>> On 10/21/2010 05:42 PM, Till Straumann wrote:
>>> On 10/21/2010 12:51 AM, Sebastian Huber wrote:
>>>> On 10/21/2010 01:49 AM, Till Straumann wrote:
>>
>> typedef union {
>> struct {
>> Chain_Node Node;
>> Chain_Node *fill;
>> } Head;
>>
>> struct {
>> Chain_Node *fill;
>> Chain_Node Node;
>> } Tail;
>> } __attribute__ ((packed)) Chain_Control;
>>

I have also similar solution. I have not had email for the last few days 
due to average networks while travelling.

Why the packed attribute ?

>> Test suites pass on ARM, MIPS and SPARC. One problem with this change
>> is that
>> the field names change, and this may break applications which use this
>> internal
>> API.
>>
> This can also be seen as an advantage since it exposes
> violations of the alias rule.
>

Agreed. I have cleaned up the const bits of the API and fixing all the 
broken bits. Sebastian, I did this while on the road and without email 
access and so did not know you had a solution. What should we do ?

Also is 4.10 ok ?

Chris



More information about the users mailing list