The warning (converted to an error due to the -Werror
option to clang
on the appliance)
control may reach end of non-void function
Says that you've a function in your program that's declared to return a value, but it's not guaranteed that it will.
For example, foo()
, in the following piece of code, is declared to return an int
int foo(void)
{
if (false)
{
return 10;
}
}
However, you're not explicitly returning anything in case the if
condition is not executed as it's the case. And that's what's meant by control may reach the end of non-void function.
Edit: when you get a compilation error, This means that the compilation process was not successful. Thus, you still don't get the executable file that you'll use to run the program (namely find
). And that's why when you try to run
./find 14
it tells you that there's no such file. To fix that, you should first fix the previous error, run
make
or
make find
if you no longer get any compilation error, then you're ready to run your program.