This is a strange bug i have created.
I use a 'c' function to calculate an unsigned long value with 64-bit unsigned integers.
There are two functions in two different files.
One file produces the the wrong value so i created another file that produces the correct results.
In order to get the correct results from the function that works i need to call both functions and use the correct results.
Both files are in the project list.
Somehow the the correct functions need the bogus function called, and the results discarded, to get the correct results.
It does not matter which order they are called but they both have to be called to get the correct results.
I guess the functions in two different file with different name interact with each other but i have not been able to find out how.
Any help would be greatly appreciated.
cheers,
rich
c files interacting in strange ways
Re: c files interacting in strange ways
I narrowed down the problem.
I put both function in the same .c file.
I started cutting out section of the function that does not need to be there but needs to be called.
It now converts an unsigned long int to an unsigned 64bit int. That's all it does, and does not use the result and returns 0.
This is very strange.
cheers,
Rich
I put both function in the same .c file.
I started cutting out section of the function that does not need to be there but needs to be called.
It now converts an unsigned long int to an unsigned 64bit int. That's all it does, and does not use the result and returns 0.
This is very strange.
cheers,
Rich
Re: c files interacting in strange ways
Offhand, I suspect that there may be a register usage issue but it is dangerous to speculate from a distance.
I'd be happy to take a look at the code if you would want to send it to me. I'm open to executing an NDA if necessary. Otherwise, it would be best to whittle the code down to the minimum that produces the unexpected result.
I'd be happy to take a look at the code if you would want to send it to me. I'm open to executing an NDA if necessary. Otherwise, it would be best to whittle the code down to the minimum that produces the unexpected result.
- Don Kinzer
Re: c files interacting in strange ways
Don,
I will zip the files up and email them to you.
No NDA necessary this is hobby work and not original except i am using ZBasic.
cheers,
Rich
I will zip the files up and email them to you.
No NDA necessary this is hobby work and not original except i am using ZBasic.
cheers,
Rich