4 ms·
I agree with you about the preprocessor example, but I bet that this is just a case of the standard being silly and real implementations are doing the right thi
by marvy 11y ago
I agree with you about the preprocessor example, but I bet that this is just a case of the standard being silly and real implementations are doing the right thing (that is, you will get an error message).
I also agree with you about bounds checking arrays: this is the wrong problem to start from when there is so much lower hanging fruit.
I want to agree with you about unspecified evaluation order, but I worry about possible side effects. If tomorrow someone waved a magic wand and all C compilers have a command line switch --left2rite that forces left-to-right evaluation order, how many programs that currently "work" by accident will suddenly break if this switch is enabled? Maybe it's very few, maybe so few that the change is a net benefit. But are you sure? The programs most likely to break are not the ones with the best test suites. I will say this though: implementing this switch is a good idea anyway, for at least two reasons. New programs can use it (at least if they don't worry about portability to a compiler that doesn't support it). More importantly, we can then start doing experiments to gather data and try to answer the question of how widespread the problem is. Until then, we'll never know.