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
Use-after-free and double-free shouldn't be able to happen unless you're doing really bad things.
1 reply 0 retweets 0 likes -
Replying to @RichFelker
They do happen in all real world C projects of non-trivial size though. Even when abstracting most forms of lifetime management.
2 replies 0 retweets 0 likes -
Replying to @CopperheadOS
You either use single-owner/single-reference, or refcounting. Anything else is idiotic.
1 reply 0 retweets 1 like -
Replying to @RichFelker
Or you use a language like Rust permitting you to do stuff like allocation-free parsing via lots of lightweight safe references.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
It's fine if the compiler tracks the origin of the lifetimes and enforces it. People use C for performance so they will do more.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
Reference counting can also be done wrong. The Linux kernel gets it wrong all over the place even when reusing code for it.
2 replies 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
Tools really need to enforce the correct way of doing things. Can have the option of defining new correct mechanisms though.
1 reply 0 retweets 0 likes -
Replying to @CopperheadOS @RichFelker
People simply aren't going to get it right without it being enforced. Even if it's a single person and they are really trying.
2 replies 0 retweets 1 like
I agree. This is why viable rules need to be statically checkable.
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.