|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |