3 ms·
I agree that missing bounds checks are the biggest problem, with the unhealthy attitude of dismissing the Annex K for political reasons. My Safe C library has o
by rurban 6y ago
I agree that missing bounds checks are the biggest problem, with the unhealthy attitude of dismissing the Annex K for political reasons. My Safe C library has only adoption with the big players.
But even weirder is the total lack of a proper string library. Nobody but Microsoft uses whar, and they are the only ones with the proper whar_t size. Everybody else was wrong with size 4. But nowadays it should be clear that only u8 is the only way forward, C++ even adopted now char8_t for it. But they all still ignore the unicode problems with an overly simplistic, glorified null-terminated memory buffer library. These are not strings anymore nowadays. Strings have multiple representations of characters in unicode, strings need the unicode version to be exposed which changes every year. They need a proper fold case and norm API, otherwise you cannot compare them, so you cannot search for strings. Grep would be happy to find unicode strings, but it still cannot. coreutils still cannot do unicode in 2020.
Also the complete lack of security, esp with names, ie identifiers. Such as pathnames. Most filesystems just ignore security, spoofing, bidi changes, mixed scripts as if this problem does not exist at all. Strings are not normalized, not properly fold cased.
The _l locale mess, it still relies on global runtime state, which is not compile-time optimizable, in opposition to _l or simply just a new u8 API. Not reentrant. Not compile-time optimizable. It's a huge mess.
gcc cannot do compile-time constexprs checks, only clang can, leading to up to 200x faster libc code. gcc cannot do user-defined warnings of errors.
glibc, FreeBSD libc, musl, none of it fixes anything.