4 ms·
Oh shi, not very reassuring knowledge spacecraft SW engineers allow signed overflow in their code.
by bvrmn 3y ago
Oh shi, not very reassuring knowledge spacecraft SW engineers allow signed overflow in their code.
- Am4TIfIsER0ppos 3y agoI would guess they don't use a language where signed overflow is undefined. I use C all day every day and that's gotta be one of the worst legacy artefacts of it. As someone else said "it isn't 1970" the system is twos complement.
- bvrmn 3y agoDefined silent signed overflow (wrapping) is worse then UB. For UB there is at least runtime diagnostic. Parent clearly ok with `-fwrapv`.
- Dylan16807 3y ago> For UB there is at least runtime diagnostic. I have no idea what you mean by this. A couple types have diagnostics, but so do overflow and wrapping. Most don't. In general, it's much easier to have runtime diagnostics for arithmetic than for UB. I guess if I squint and "silent" implies you're not allowed to install diagnostics, then it's worse? But that's so artificial of a comparison as to be silly.
- Dylan16807 3y agoEven if the system is definitely twos complement, it's bad for i+1 to sometimes be less than i.