Warning: C12056

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Warning: C12056

跳至解决方案
3,045 次查看
HarryHirn
Contributor I

Hi,

 

i get more than one time the compiler warning at function returns:

 

Warning: C12056: SP debug info incorrect because of optimization or inline assembler

 

Codewarrior 4.7 with compiler options -Cf -CPUHCS12 -Mb -TD4LD4LLD4

 

uc: 9S12DP512DGV

 

i got a really big structure with 100 elements (ram address 0x874 - 0xe51) and incresed the stack to 512 byte, which solved some ram messup :smileyhappy:

 

i think i saw the warnings the first time i included math.h but im not sure about that.

 

fact is that im not using any inline assembly where the warnings occour.

 

may the warning be risin by the math.h?

or the big size of my structure?

 

grtz

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,482 次查看
CompilerGuru
NXP Employee
NXP Employee

 

may the warning be risin by the math.h?

or the big size of my structure?

 


Including math.h itself does not cause it, also the size of structures does not matter.

 

I did explain the setup for this warning for example here:

 

 

https://community.freescale.com/message/66191#66191

 

The warning is more likely in huge functions and when some patterns are repeated multiple times. Using floating point increases the chances of this as even simple C statements can generate patterns big enough to optimize.

 

Also note that C12056 is not an error, "just" informs about one case of problematic debug information. Use -onf to switch the optimization of, but this will increase the code size (depending on the code possibly by quite a bit).

 

Daniel

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,483 次查看
CompilerGuru
NXP Employee
NXP Employee

 

may the warning be risin by the math.h?

or the big size of my structure?

 


Including math.h itself does not cause it, also the size of structures does not matter.

 

I did explain the setup for this warning for example here:

 

 

https://community.freescale.com/message/66191#66191

 

The warning is more likely in huge functions and when some patterns are repeated multiple times. Using floating point increases the chances of this as even simple C statements can generate patterns big enough to optimize.

 

Also note that C12056 is not an error, "just" informs about one case of problematic debug information. Use -onf to switch the optimization of, but this will increase the code size (depending on the code possibly by quite a bit).

 

Daniel

0 项奖励
回复