|
![](/i/fill.gif) |
Invisible <voi### [at] dev null> wrote:
> > It can be argued using the same logic as with uninitialized variables,
> > though: There are situations where execution never reaches the end of the
> > function, and hence having a 'return' statement there would be useless.
> Sure. But like I said, the Java compiler seems to detect this.
But the C++ compiler cannot break the standard by making the situation
an error. It can only issue a warning.
(And besides, any kind of detection of this cannot be 100% accurate,
as the problem "will this line of code ever be reached?" is unsolvable
in the general case.)
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |