3 ms·
Throw away? Hopefully that means replace it with a crash? If it's just carrying on, that sounds bad.
by notfed 3y ago
Throw away? Hopefully that means replace it with a crash? If it's just carrying on, that sounds bad.
- junon 3y agoYes, throw away entirely.
- muldvarp 3y ago> If it's just carrying on, that sounds bad. Why? If you are an experienced C or C++ programmer you know about these quirks. Replacing an infinite loop without side effects with a crash sounds about as "bad" as optimizing it away.
- lpribis 3y agoWhat about baremetal embedded system code where there is no concept of a 'crash'? Sure you can emit a trap instruction/bus fault/etc, but what to emit for the trap handler code?
- vbezhenar 3y agoIn the linked example clang just compiled function to nothing. In practice it means that CPU will run over random memory after calling this function. It probably will cause a crash, but may be it'll format a disk, who knows. https://godbolt.org/z/zTz1488P3 https://godbolt.org/z/zTz1488P3