Agree. For control flow, I think it makes more sense to warn for if and switch than for the loop constructs.
/ Niels Möller ()
Previous text:
2003-02-12 21:17: Subject: Search bug ?
I think it's very obscure that the type system creates errors, that with the same input wouldn't generate an error runtime.
I'd like to instead see warnings,
- when equal and `== gives constant results:
1==1, 1==2 equal( ({1}), ({2}) )
- when the code flows on constant results:
if (1) ... if (0) ... switch (0) ...
In these cases it's very probable that you didn't want to do that. But to make sure you can do that anyway without warning, how about a pragma to turn off that specific warning?
Some constant flow control is common and is probable futile to warn for, so we should possibly not do that here:
for (;;) ... while (1) ... do ... while (0);
/ Mirar