Qorivva: sizeof a structure with bitfields

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

Qorivva: sizeof a structure with bitfields

672 Views
pascalbrand
Contributor I

Hello,

 

Using CodeWarrior for MCU, v10.7, on Qorivva target, I am not able to understand the size of the current structures: S1 has size 1 (not expected - I was expecting 4, following the section "21.4.6 Bitfields" of the documentation MCU_Power-Architecture_Compiler.pdf), wheras S2 has size 4 (as expected):

 

    struct S1 {
        unsigned int a: 4;
        unsigned int b: 3;
        unsigned char c:1;
    };

    struct S2 {
        unsigned char c:1;
        unsigned int a: 4;
        unsigned int b: 3;
    };

 

Could you elaborate?

 

Thanks for your support,

Pascal.

 

PS: I have attached the project to highlight it.

Original Attachment has been moved to: MPC-C.7z.zip

0 Kudos
Reply
3 Replies

571 Views
pascalbrand
Contributor I

Hello ZhangJennie‌,

could you have a look?

Thanks,

Pascal.

0 Kudos
Reply

571 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Pascal,

I don't work for Qorivva.

I would suggest you create a private case to NXP support team directly it.

https://community.nxp.com/docs/DOC-329745?sr=search&searchId=356ea1f0-531d-4edb-b1aa-a707baa9ce8c&se... 

Best Regards,

Jennie Zhang

0 Kudos
Reply

571 Views
pascalbrand
Contributor I

Thanks a lot.

I've just created it as "NXP Support case #00136577".

Best regards,

Pascal.

0 Kudos
Reply