[ale] C++ "not all control paths return a value"

Jim Popovitch jimpop at yahoo.com
Fri Jan 28 17:07:22 EST 2005


Btw, shame shame for posting a question about DOS/Windows coding to a
Linux list. ;-)

-Jim P.

On Fri, 2005-01-28 at 16:31 -0500, Jay Loden wrote:
> I've got some code that compiles, but with a warning for the following 
> function:
> 
> string truncPath(string name){
>     if(name.substr(1, 1) == ":"){
>         for(int k=0; k < 30; k++){
>             if(name.substr(name.length()-k, 1) == "\\"){
>                 string ret = name.substr(name.length()-k+1, k);
>                 return ret;
>             }
>         }
>     }
> 
>     else{
>         return name;
>     }
> }
> 
> Saying "Not all control paths return a value" - what does this mean, am 
> I missing something in my code?
> 
> -Jay
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list