Footguns
Footguns
Posted Jul 11, 2021 21:13 UTC (Sun) by pizza (subscriber, #46)In reply to: Footguns by smurf
Parent article: Rust for Linux redux
> My point is that C / C++ doesn't have any features to declare whether, or to what extent, any given code is "safe" or "unsafe". Like "this value might be aliased" (one of the zillion possible meanings of "volatile" …) or "this here is a pointer; that there is an array of size 42" or "tell me if this integer operation overflows".
Ah, okay. Thanks for the clarification. FWIW I think I'm in agreement with you.
Unfortunately, most of my professional C slinging has been with code that is inherently "unsafe". I do wish the C standards folks would try to improve bare-metal usecases instead of trying to make C more like (the awful parts [1] of) C++.
...On the other hand, I recently had to write a userspace DMA driver.. in Python. Talk about the worst of all possible worlds...
[1] which IMO is "most of it"