4 ms·
The C standard allows the compiler to do this, so it's definitely not a bug in the compiler.
by frederikvs 9y ago
The C standard allows the compiler to do this, so it's definitely not a bug in the compiler.
- mpweiher 9y agoAs I wrote earlier: I had a C compiler before there was C standard. So by your definition, this compiler could not have bugs? As an exercise, try to express the difference between "standards-compliant" and "bug-free".
- kutkloon7 9y agoI think the main point is that if there is a standard, an implementation should comply. If there is no standard, you have to use intuition and common sense to say what's a bug. Different people may have different expectations, so bugs become subjective. Ideally, there is a water-tight standard. In this case every deviation from the standard is a bug and vice versa.
- mpweiher 9y ago> if there is a standard, an implementation should comply Yes. However, we are talking specifically about the parts where the standard is undefined. The standard most emphatically does not require a compiler to do these crazy optimizations that remove safety critical code.