I want to optimize a specific function of c code to 0 in m52259 codewarrior.

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

I want to optimize a specific function of c code to 0 in m52259 codewarrior.

Jump to solution
1,002 Views
santoshkubasad
Contributor I

Hello I want to optimize specific function to 0 optimiation. Please let me know the syntax for it. I tried

 

#pragma GCC push_options

#pragma optimization_level 0

void fun()

{

----

-----

}

#pragma GCC pop_options

 

Not sure whether it is correct syntax or not. Please help me. Thanks

Labels (1)
0 Kudos
Reply
1 Solution
792 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Santosh:

Sorry for the time with no responses.

Please try with the next syntax:

#pragma optimization_level 0

void fun()

{

//.....

}

#pragma optimization_level reset

This should work.


Regards!,
Jorge Gonzalez

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

View solution in original post

0 Kudos
Reply
2 Replies
793 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Santosh:

Sorry for the time with no responses.

Please try with the next syntax:

#pragma optimization_level 0

void fun()

{

//.....

}

#pragma optimization_level reset

This should work.


Regards!,
Jorge Gonzalez

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

0 Kudos
Reply
792 Views
santoshkubasad
Contributor I

Hello Jorge,

     Thanks for the reply, issue solved, but recently i tried to update codwarrior to version10.6 and MQX to 4.0.2 when I create a new sample project of existing example project I am getting lot of compiler errors. Do I need any extra patch or any software to get the program executed. I have also attached the snapshot of the example project for your reference. Please guide me. Thankscw10.6.jpg

0 Kudos
Reply