3 ms·
> That is an incorrect assumption, as it clearly does. That’s my entire point. Compiler is free to make incorrect assumptions. > It is also incorrect given th
by yakubin 4y ago
> That is an incorrect assumption, as it clearly does.
That’s my entire point. Compiler is free to make incorrect assumptions.
> It is also incorrect given the standard text.
According to C11 standard, section 3.4.3, the standard imposes no requirements on undefined behaviour.
- mpweiher 4y agoA compiler that makes incorrect assumptions is a bad compiler. In fact, in the rationale of the original spec., I remember reading that the C standard was expressly designed to be a minimal spec, and that just being compliant with the spec was insufficient for the resulting compiler to be fit for purpose. And of course the original spec did specify a range of acceptable behaviors, and that language is, in fact, still in the standard. It was just made non-binding. However, it is still there, and pretending it is not seems disingenuous at best.
- GrumpySloth 4y ago> A compiler that makes incorrect assumptions is a bad compiler. I agree, but that includes GCC and Clang. ¯\_(ツ)_/¯
- mpweiher 4y agoYep. The problem when you rely on free software is that you are not a customer.