>>190
1. Real string library. Yes, ASCIIZ was a mistake.
Your "real strings" are in C++. Use that instead of turning C into C++.
2. Expanded standard library. File system abstractions are the big one. Why do we assume all implementations will have files but not folders? struct packing is another problem that is incredibly common and frequently done horribly horribly wrong, but solved with a very simple library.
Folders are different in every filesystem. How would a standard way of representing directories work since different OSes and filesystems use '\', '/', '::', ':', and '.' as path separators? How would the files be enumerated in directories? What would it do with a directory called
C/C++ standard headers? How would it handle drive letters in Windows or DOS? What about future OSes?
<dirent.h> is only useful for POSIX directories.
_Alignof and
_Alignas were added to C11 for struct packing.
3. Minor stylistic fixes including non-semicolon terminated labels before end of block, const const cast fixes, remove the untagged nested struct/union bubbling crap, remove the sole register storage class semantic.
Why remove
register? It's a hint that the address of the object cannot be taken.
4. Better specified sequence point model, in particular synchronizing the order of execution of side-effects between sequence points with the order of evaluation.
C leaves the order of ++/-- and argument evaluation unspecified to make it easier for the compiler to optimize for that machine. If you care about the order, use the comma operator or split it into separate statements. Scheme also leaves the order of argument evaluation undefined.
5. Consolidation of types. The int, short, long, long long, uint, ushort, ulong, size_t, ptrdiff_t, int, uintn_t, intn_t, intptr_t, int_fastn_t, uint_fastn_t, int_leastn_t, uint_leastn_t, uintptr_t crap is just remarkably stupid. int and char should be implementation defined widths, but it does not make sense for anything else.
Not everything uses 8-bit bytes and 32-bit longs. Some Crays use a whole 64 bits for chars because it's faster than using shift and mask. For people who only use MSVC, this doesn't matter, but people who care about portability want to make sure their code still compiles 60 years from now.
6. Better error handling mechanisms. Huge swathes of most large codebases are dedicated to checking return values, the errno crap is incredibly stupid, not thread safe, not even internally consistent. Look at the code for parsing a long in man 3 strtol, and compare with Java catch(NumberFormatException e).
The Linux man pages are full of GNU-style crap which is usually the most compilcated way to write code.
errno is thread-safe on all systems with multi-threaded C libraries (even Windows and Linux). If it isn't thread-safe and the OS is, you should file a bug report with the compiler manufacturer (if you're not using a 15-year-old compiler). Again, if you want C++ features like exceptions, use C++.
errno = 0;
val = strtol(str, &endptr, base);
if (errno) {
/* handle error */
}
7. Unicode support, wide characters are a fucking plague.
Unicode has been added to C11. I checked the date on your post twice to make sure I wasn't responding to a post from 2006.