POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Teach yourself C++ in 21 strange malfunctions Server Time
30 Jul 2024 00:22:48 EDT (-0400)
  Re: Teach yourself C++ in 21 strange malfunctions  
From: Darren New
Date: 19 Apr 2012 21:53:06
Message: <4f90c182@news.povray.org>
On 4/18/2012 4:13, Warp wrote:>    But the C++ compiler cannot break the 
standard by making the situation
> an error. It can only issue a warning.

You mean, the C++ compiler cannot break the C standard by making this 
illegal. Even tho it makes other valid C programs illegal. :-)

>    (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.)

But detecting type errors isn't 100% accurate either.

   int x = 1 ? 5 : "hello";

That's not legal, but it's not a type violation either.

-- 
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.