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 22:29:45 EDT (-0400)
  Re: Teach yourself C++ in 21 strange malfunctions  
From: Darren New
Date: 19 Apr 2012 21:36:36
Message: <4f90bda4$1@news.povray.org>
On 4/17/2012 3:16, Invisible wrote:
> It gives you warnings if code is unreachable.

It gives you warnings if it thinks the code is unreachable. It gives you an 
error and won't let it compile if it can prove you have unreachable code.

{ int x = 0; return; x = 1; } // Gives an error.
{ int x = 0; if (true) return; x = 2; } // gives a warning.

> It even complains if you have a void function that uses return just to exit
> early, and there's nothing afterwards...)

I didn't run into that.

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

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