Most unsafety comes from doing backwards things you shouldn't even be doing in modern C.
-
-
Replying to @RichFelker
Use-after-free, double-free, out-of-bounds accesses, etc. happen in every C codebase, even with extreme diligence like SQLite.
2 replies 0 retweets 1 like -
Replying to @CopperheadOS @RichFelker
It's also infeasible to even deploy instrumentation taking a 2-3x performance hit to provide basic memory safety for C code.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
It ends up catching too many real world latent bugs where code is doing things that are undefined but not breaking (noticeably).
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
Could definitely write safe C code by defining a safe dialect with annotations, and having the compiler verify memory safety.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS
I think it's plausible you could well enough without annotations, just a subset of the language excluding bad stuff.
2 replies 0 retweets 0 likes -
Replying to @RichFelker
Annotations meaning stuff like forcing pointers to be passed with a size marked as being associated, forcing bounds checks, etc.
2 replies 0 retweets 0 likes -
-
Replying to @RichFelker
Array indexing is just pointer arithmetic. Pointers as a whole are extremely unsafe without a whole bunch of enforced rules.
1 reply 0 retweets 0 likes -
You could cheat and keep strings by only allowing snprintf & passing to std functions (paths etc.), no other access.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.