How to disable optimization for protecting an unused function

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

How to disable optimization for protecting an unused function

1,153件の閲覧回数
jasoncui
Contributor II

I created a function, and didn't call it in my project, the compiler treated it as unused dead code and removed it by the linker. I hope the optimization doesn't work only for this function, how can I do? The CodeWarrior I used is ver5.9, and the MCU is MC9S12G128.

 

Any help would be much appreciate!

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

966件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Jason.

add the function name to ENTRIES block in prm file can avoid unused function being optimized. can you please try it? can it work for you?

pastedImage_0.png


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

966件の閲覧回数
jasoncui
Contributor II

Hi, Jennie

I works well. Thanks a lot.

0 件の賞賛
返信

966件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

you are welcome!

Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信