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

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

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

ソリューションへジャンプ
2,562件の閲覧回数
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 件の賞賛
返信
1 解決策
2,551件の閲覧回数
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.

元の投稿で解決策を見る

1 返信
2,552件の閲覧回数
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.