Closed
Description
Guaranteeing that int
and uint
are always at least 32 bits fixes the class of bugs and security holes that worries me most in #9940
Scenario:
- Programmers use
int
anduint
in library code and sample code explicitly, or by thinking of them as the "default integer types," or via integer type inference. See consider removing the fallback to int for integer inference #6023 - When reusing that code on a 16-bit embedded processor (e.g. in robotics and IoT devices -- Rust would be very compelling for such applications), it has bugs when
int
anduint
overflow in 16 bits, which is not difficult.
I encountered this problem when programming in C++ on Palm OS. (It's a 16-bit OS even on devices that used a 32-bit ARM to emulate the 68000.)
Of course there are alternate solutions.
Metadata
Metadata
Assignees
Labels
No labels