POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Teach yourself C++ in 21 strange malfunctions Server Time
29 Jul 2024 18:16:37 EDT (-0400)
  Re: Teach yourself C++ in 21 strange malfunctions  
From: Warp
Date: 18 Apr 2012 07:13:35
Message: <4f8ea1df@news.povray.org>
Invisible <voi### [at] devnull> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.