I am suspicious that using the same variable names and types in two functions might cause unexpected outputs in the C6000 compiler.
The code below is a representation of the code that I implemented.
int foo_2(float a, Struct *b) {
b->c = a * b->d;
return b->c;
}
int foo_1(float a, Struct *b) {
int c = 0;
c = foo_2(a, b);
return c;
}
The problem is when I did this the output is random garbage.
I know this is legitimate in C and should work with something like Visual Studio,
but I don't know why this produce garbage on dsp with the C6000 compiler.
Please advise me how to debug the problem.