Conversation

Sure, and as I've stated many times in this conversation, I would like for C to be more strongly specified. However, defining something like signed integer overflow as guaranteed to wrap would be a step backwards for implementations that want to make it safer such as trapping.
2
2
This Tweet was deleted by the Tweet author. Learn more
It's always implemented in software via hardware features. The features vary in performance. Jump-on-overflow is a lot worse than architectures with support for enabling a trapping mode, whether it's strict or propagates a poison value that can never be accessed (since it traps).
1
1
Hardware doesn't implement C, so there isn't a standard behavior defined by hardware. It's up to the compiler to map C onto the hardware or the virtual machine. They get to choose how to handle each kind of undefined or implementation defined behavior, and everything else.
2
1
No, that's not what I've been saying. I think it would be a serious regression to break compatibility with safe implementations by making it correct to be incompatible with them. You want to massively roll back safety and security, especially if you want to remove it by default.
2
1
It is a big deal, because it would start on the path towards making signed integer overflow as hard to enable as unsigned integer overflow. The current definition of the standard makes it far easier, and therefore makes C into a safer language when the implementation wants that.
1
It's enabled by default in substantial portions of Android, including for lots of software that was / is developed externally. I think Android counts as something that is broadly deployed. I'm sure it's used elsewhere but that's what I work on so I'm familiar with it.
1
Show replies
Signed integer overflow is always a bug (unless -fwrapv is passed, which isn't portable), so it can reported and fixed as a bug in software. It's also detected by default by tools like UBSan designed to catch UB. Since unsigned overflow is well-defined, that makes it harder.
1
Show replies