Dumb compiler or dumb coder?

Started by
20 comments, last by Willm 19 years, 11 months ago
I agree with Jingo in that the fact that division by zero is undefined means it can''t be ruled a compiler bug. However I think that it would be much more useful for the compiler to warn in this situation rather than error, since the result of the constant folding may exist in a path that''s never executed. I didn''t mean to sound like I was talking down to you. It just seemed like you may not have known about how parse trees and constant folding work, and you never know who you''re talking to on these boards.
Advertisement
The true part of that statement is completely constant. The compiler will try to substitute it with the result before it even has a look at the statement and realises that it doesn''t need it anyway.

This topic is closed to new replies.

Advertisement