News for hackers. Stuff that matters.
Re:Checked integer arithmetic in the prospect of C23 by tinus_hn on Monday December 19, 2022 @06:54PM (#34059586)
C is supposed to be reasonably portable so it doesn’t make too much sense to depend on flags that are not available on all platforms.
Re:Checked integer arithmetic in the prospect of C23 by int_19h on Monday December 19, 2022 @07:17PM (#34059789)
It's easier to find a platform that doesn't support floating-point numbers than one that doesn't have some kind of overflow flag. Some kind of platform-independent abstraction is long (as in, decades) overdue.
Re:Checked integer arithmetic in the prospect of C23 by noobermin on Monday December 19, 2022 @07:19PM (#34059811)
Sure, but it kind of is insane that there are platforms (like ARM apparently, did not know) that do NOT have a carry flag.
Re:Checked integer arithmetic in the prospect of C23 by derefr on Monday December 19, 2022 @08:26PM (#34060345)
Why can’t it be a flag on some platforms and complex hereafter branching logic on other platforms? Like the division shim on platforms that don’t have a division instruction?