Function parameters allocated at same address

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

Function parameters allocated at same address

跳至解决方案
802 次查看
dordestojicevic
Contributor II

Hi everyone,

 

I have a problem with one function and function parameters. I am using:

- CodeWarrior for MCU

     Version: 10.6

     Build Id:140329

with Hearst Board with S12ZVC on it.

 

I have a function like this:

 

void detrend(uint16 *nfft, sint32 newelement, sint16 *timedata, sint32 average)

 

Problematic are nfft and timedata. To nfft I pass the address of single variable, to timedata I pass the beginning of an array.

 

nfft itself is always allocated in the address range of an array pointed by timedata.

 

The same thing occurs when I use regular function local variable instead of pointer for nfft, only then this local variable is allocated in the address range of the array pointed by timedata.

 

Any ideas?

 

Thanks

标签 (1)
1 解答
731 次查看
dordestojicevic
Contributor II

Hi Jennie,

meanwhile I figured it out. I was overflowing the memory.

How to find this out is to declare those global. Then during compiling you would get an error. If those are local, it would just overwrite not really noticing you about anything.

Would be a nice feature to have a warning for this.

在原帖中查看解决方案

2 回复数
731 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

hi Dorde,

To investigate your problem correctly and efficiently, please provide us the follows:

1. demo project

2. how to reproduce your problem step by step with your demo project.

thanks for your cooperation!


Have a great day,
Zhang Jun

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

0 项奖励
回复
732 次查看
dordestojicevic
Contributor II

Hi Jennie,

meanwhile I figured it out. I was overflowing the memory.

How to find this out is to declare those global. Then during compiling you would get an error. If those are local, it would just overwrite not really noticing you about anything.

Would be a nice feature to have a warning for this.