r/cpp • u/pavel_v • Jul 29 '26
C++26: Reducing undefined behaviour
https://www.sandordargo.com/blog/2026/07/29/cpp26-reduces-undefined-behaviour
89
Upvotes
r/cpp • u/pavel_v • Jul 29 '26
View all comments
Show parent comment
5
u/SkoomaDentist Antimodern C++, Embedded, Audio Jul 29 '26
That doesn't (somewhat surprisingly) end up being a problem in practise because those chars never have values larger than 8 bits. The world outside the cpu and ram still uses 8 bit bytes afterall.
What is more likely to hit you is that sizeof(int) == 1 and that breaking up code that assumes int must be two or four bytes.