Topic : Problems with function arguments

Forum : 8051

Original Post
Post Information Post
March 2, 2010 - 4:31pm
Guest

We are experimenting a problem with our code over SiLabs C8051F55x and Raisonance compiler.

We are working with next compiler + linker flags:

ASM Compiler: EP PATHINCLUDE (...)
C Compiler: LARGE DB OE QUIET PATHINCLUDE (...)
Linker: DL DP DS RS(256)

In some functions calls our arguments are not passed correctly to the body of the function, it is:

If I call, for instance, a function called: FunctionXX( Value1, Value2), Value1 and Value2 depending of the compilation are not correct inside FuntionXX it is:

FunctionXX( UI val1, UI val2 )
{
// Here Val1 and Val2 are no correct. Val1 is different than Value1 and Val2 is different than Value2
}

Testing and testing we have even tried to put constant values in the function call and the result have been the same.

Looks strange make a call like that:

FunctionXX( 1, 5 );

And look that the values are not correct inside the function.

Do you have some idea what can be happenning?

Replies
Post Information Post
+1
0
-1
March 5, 2010 - 10:54am
Raisonance Support Team

Hi Carles,

Thanks for your report. This behavior is surprising!

1) Ensure that you are using the same compiler options for the whole project.
2) When you perform a printf on your arguments are they correctly displayed?
3) Are the caller and callee functions in the same C file and check what happens.

If you still think there is a problem after you complete these tests, can you send us a failing project and the details about how to reproduce, so that we can try to understand what happens?

Thanks,
Bruno