How to specify the size of enum type variables in S32DS3.4 for S32K

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

How to specify the size of enum type variables in S32DS3.4 for S32K

Jump to solution
2,691 Views
jinjingyang
NXP Employee
NXP Employee

Dear sir,

Customer want to have all enum type variables with size of uint32 type.

But S32DS will set all enum to its minimum size.

If the max value of a enum variable is less than 255, its size will be 1 byte.

But customer want that all enum variables be 32bit size.

How can we configure this compiler option?

I have tried to remove the optimization option "-fshort-enums" but it doesn't work.

Could you please provide some possible methods? 

0 Kudos
Reply
1 Solution
2,680 Views
jinjingyang
NXP Employee
NXP Employee

I just found that the compiler option "-fno-short_enums" can be used to resovle this issue.

With this option, the enum type will be 32bit size.

By default, the option "-fshort_enums" is used, which will use minimum size for enums.

So please close this topic.

View solution in original post

1 Reply
2,681 Views
jinjingyang
NXP Employee
NXP Employee

I just found that the compiler option "-fno-short_enums" can be used to resovle this issue.

With this option, the enum type will be 32bit size.

By default, the option "-fshort_enums" is used, which will use minimum size for enums.

So please close this topic.