That would be nice. You hit on the other hell with C strings: modern encodings where wchar_t and mb* are useless and replacements essentially don't exist yet with char8_t, char32_t etc. Then there's the locale chaotic nonsense [1]. A new libc starting fresh would be nice.
1. https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f02...
Re:Git's list of banned C functions
by matheusmoreira on Friday March 05, 2021 @03:01AM
(#26354127)
> A new libc starting fresh would be nice.
Agreed. I want to make something like this on top of Linux one day. I discarded the entire libc and started from scratch with freestanding C and nothing but the Linux system call interface. Turns out the Linux system call interface is so much nicer.
https://github.com/matheusmoreira/liblinux/blob/master/examp...
Why can't we just have some nice structures instead?
All I/O functions should use structures like these. This alone would probably prevent an incredible amount of problems. Every high-level language implements strings like this under the hood. Only reason C can't do it is the enormous amount of legacy code already in existence...