All the other build systems I've used will fail to compile if a function has a return type but not all code paths lead to a
return statement, except for IDF. In IDF, functions build just fine and usually I find the bug in the form of a stack corruption; though in the following case, omitting the return statement causes the loop to run infinitely.
Code: Select all
int example()
{
for (int i = 0; i < 32; i++)
{
printf("i = %i\n", i);
}
}
Is this expected behaviour? I feel like this is an issue with the build system or compiler. This only happens when building C++ files. If I try the same thing in a C file, the compiler throws the following error:
error: control reaches end of non-void function [-Werror=return-type]
Assuming this is a bug, where should I make the report?