[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Fri Jan 28 17:08:40 2005 -->
- <!--x-from-r13: ibypvznfgre ng tznvy.pbz (Ineera [lref) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] -->
- <!--x-reference: 1106949510.24825.5.camel@blue --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] C++ "not all control paths return a value" -->
- <li><em>date</em>: Fri Jan 28 17:08:40 2005</li>
- <li><em>from</em>: volcimaster at gmail.com (Warren Myers)</li>
- <li><em>in-reply-to</em>: <1106949510.24825.5.camel@blue></li>
- <li><em>references</em>: <<a href="msg01281.html">[email protected]</a>> <1106949510.24825.5.camel@blue></li>
- <li><em>subject</em>: [ale] C++ "not all control paths return a value"</li>
On Fri, 28 Jan 2005 16:58:30 -0500, Jim Popovitch <jimpop at yahoo.com> wrote:
> Since your func is defined as retuning a string, that warning is
> alerting you that parts of your code don't return a string.
> Specifically if the variable "name" contains a ":" but never a "\" your
> func will return without a valid return value.
>
> -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
> > <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
>
--
<a rel="nofollow" href="http://warrenmyers.com">http://warrenmyers.com</a>
"Don't let the elephants see what the rabbits are doing." --Ben R Rich
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01281" href="msg01281.html">[ale] C++ "not all control paths return a value"</a></strong>
<ul><li><em>From:</em> jloden at toughguy.net (Jay Loden)</li></ul></li>
<li><strong><a name="01283" href="msg01283.html">[ale] C++ "not all control paths return a value"</a></strong>
<ul><li><em>From:</em> jimpop at yahoo.com (Jim Popovitch)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01284.html">[ale] C++ "not all control paths return a value"</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01286.html">[ale] mailx</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01283.html">[ale] C++ "not all control paths return a value"</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01284.html">[ale] C++ "not all control paths return a value"</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01285"><strong>Date</strong></a></li>
<li><a href="threads.html#01285"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>