Codewarrior 11.1 __attribute__((bitfields(little_endian)))

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Codewarrior 11.1 __attribute__((bitfields(little_endian)))

1,518 Views
R_R_Ritchey
Contributor II

I am using Codewarrior 11.1 and need to specify a couple structures to be stored in memory as little candida format.  Supposedly the attribute " __attribute__((bitfields(little_endian)))" is suppose to accomplish this but it seems to just be ignored.  Can anyone tell me if this is basically a nop in Codewarrior 11.1 when compiling for Coldfire?  If not, is there some special way it needs to be used to actually be activated.  Thanks.  

0 Kudos
Reply
3 Replies

1,352 Views
R_R_Ritchey
Contributor II

I guess my question on this reply is, how does it apply to my original question?  This seems to have nothing to do with why an attribute that is documented in CodeWarrior 11.1 does Nothing.

You can find the reference here: CodeWarrior for Microcontrollers V11.x > ColdFire for Microcontrollers > ColdFire Build Tools Reference Manual > Addressing > Sections > Bitfield Ordering

The example code does not work. According to the current documentation, the compiler should allow a structure to be stored in little endian format when this attribute is used.  The compiler does not complain about it, it just seems to ignore it with no warning or other notification it is ignoring it.  

0 Kudos
Reply

1,352 Views
soledad
NXP Employee
NXP Employee

Hi, 

The compiler generates code to access both LE and BE bitfields. 

We don't see a problem with the example. 

Note the attribute defined how the bitfield is stored in memory, the value is always converted to the native endian of the machine when the value is in a register.

Regards

Soledad

0 Kudos
Reply

1,352 Views
soledad
NXP Employee
NXP Employee

Hi, 

Please check the following link and let me know if this helps, 

A little or big Indian? A Plea for Peace… | MCU on Eclipse 

Regards 

Soledad

0 Kudos
Reply