I have found what looks like a compiler bug to me. I am using TI v5.1.5 for an RM48 platform. I have found that if a function has no parameters and the declaration of that function does not use void in the parameter list, there appears to be no checking of parameters when the function is called. The function can be called with an arbitrary amount of parameters with no compiler error or warning. I looked closer and found that the assembly produced pushes these parameters onto the stack just as it should if the parameters were supposed to be there. Here is an example in case there is any ambiguity. I have tried this in multiple projects and found identical results.
int foo();
int main()
{
foo(1, 2, 3, 4, 5); // NO COMPILER ERROR!
}
int foo()
{
//Do something.
}
Thanks,
Westin