How to change optimize level for one function in codewarrior11?

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

How to change optimize level for one function in codewarrior11?

Jump to solution
1,777 Views
Wangerxi
Contributor II

I tried use 

#pragma GCC push_options

#pragma GCC optimize("O0")

/*my code function*/

#pragma GCC pop_options

 

after compiled the warning:#pragma GCC target is not supported for this machine [-Wpragmas]

 

Is there any other solutions?

0 Kudos
1 Solution
1,701 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi,

 Please try the following code for function optimization.

__attribute__((optimize("O0")))void func(void)
{
/* Your code*/
}

Have a great day,

Felipe

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored. Please open a new thread and refer to the closed one, if you have a related question at a later point in time. 

------------------------------------------------------------------------------ 

View solution in original post

0 Kudos
3 Replies
1,766 Views
Wangerxi
Contributor II

Chip number is S9KEA64

0 Kudos
1,702 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi,

 Please try the following code for function optimization.

__attribute__((optimize("O0")))void func(void)
{
/* Your code*/
}

Have a great day,

Felipe

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored. Please open a new thread and refer to the closed one, if you have a related question at a later point in time. 

------------------------------------------------------------------------------ 

0 Kudos
1,770 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI

What's your chip part number? please let us know thus we can assign right engineer for your issue.

Thanks,

Jun Zhang

0 Kudos