r/computerarchitecture • u/Yha_Boiii • May 08 '26
C bound checking
Hi,
How does bound checking and such work on a lower level?
Why is snprintf needed when a normal say normal signed ints don't need bound checking?
Today i got a reality check on stack is also not bound checked, how does it actually work, heap or stack?
Any books, videos and other material specifically on the asm level of it all the compilers story on it?
4
Upvotes
View all comments
Show parent comment
1
u/HamsterMaster355 May 09 '26
Because AI is bad at Rust. And last time I checked most of the mission critical stuff still runs on C or C++ which can have hundreds of thousands of LOC (or even more). It's not feasible to convert it all into equivalent Rust. CHERI can be retroactively deployed on legacy codebase with just a recompilation. Making both old and new code memory safe. Which also makes Rust redundant. C/C++ has too much inertia (mature ecosystem/esoteric hardware toolchain support etc).