Home » Developing U++ » U++ Developers corner » AString::Compare missing explicit return value (q will = 0 if the loop isn't broken. This value should be returned explicitly.)
Re: AString::Compare missing explicit return value [message #44085 is a reply to message #44081] |
Tue, 23 December 2014 14:53   |
|
Hi rainbowsally,
There was nothing wrong with the function. If you look carefully, you'll find out that the line you added will actually never be called There is no way the code evaluation could get out of the infinite for-loop, other than one of the first three return statements.
So even though some compilers might warn about missing return statement, there is actually no problem or undefined behavior in this function.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Sat Jul 19 04:53:08 CEST 2025
Total time taken to generate the page: 0.00656 seconds
|