What compiler, and which version of it are you using? (If it is avr-gcc, then "avr-gcc -v" should give the version number)
I seriously don't understand why these are errors, and why the patch you proposed could fix them. Normally if the function is declared or defined before usage, it is fine, and the codebase is full of such constructs (functions only having definitions, being used later down in the code). It is completely valid by the specification of C (and I can't even remember for example the MISRA-C coding guidelines saying anything against this).
Of course that particular game might have something else in it which makes it invalid, but it is not apparent for me at first glance. I will examine the code later this day.
Does your compiler compile these?
Code: Select all
int test(void){
return 1;
}
int main(void){
return test();
}
Code: Select all
inline int test(void){
return 1;
}
int main(void){
return test();
}
Code: Select all
inline int test(){
return 1;
}
int main(void){
return test();
}
The last one is somewhat fishy for me, in C this would mean unspecified number of arguments (no "void"), possibly people coming with C++ background forget it and make the mistake of omitting the "void". I don't know for sure how the compiler should react to this (I rarely see this construct).