Unlike Java, in C/C++ following is allowed:
int* foo () { if(x) return p; // what if control reaches here }
This oft
You can convert the warning into an error by using the following compiler options
-Wreturn-type -Werror=return-type.
-Wreturn-type -Werror=return-type
Check out This link