logoalt Hacker News

grg0 • last Sunday at 10:17 PM • 1 reply • view on HN

I don't think that's what he's talking about. The problem with those CVEs is an unsigned type with default wrap semantics. But it need not be like that. Look at how Ada allows user-defined integers.


Replies

Joker_vD • yesterday at 4:32 AM

The user-defined integer types in Ada are either a subrange of the signed integers, or have modular semantics exactly as that that "unsigned T" have in C/C++. If we're talking about the additional range checks, they're only performed on an assignment to a variable. So, no, I don't exactly see how Ada's semantics would help here.