`getContent` : not all control paths return a value
This is a warning I get while compiling a C program, where getContent is a bool method with website name and a buffer as its parameters and it is called recursively within that function if a desired page is not retrieved in the buffer.
How can I remove this warning?
not all control paths return a value
This warning occurs when, well, not all control paths return a value. For example, the following code may produce the warning.
int f(bool b)
{
if(b)
{
return 42;
}
}
In order to fix this warning, you should return a value from all control paths.
int f(bool b)
{
if(b)
{
return 42;
}
return 50; //<--
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With