Codewarrior 11.1 __attribute__((bitfields(little_endian)))

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Codewarrior 11.1 __attribute__((bitfields(little_endian)))

1,521件の閲覧回数
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 件の賞賛
返信
3 返答(返信)

1,355件の閲覧回数
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 件の賞賛
返信

1,355件の閲覧回数
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 件の賞賛
返信

1,355件の閲覧回数
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 件の賞賛
返信