C. C libraries
Not surprisingly, C library implementations lack most of the support for C23 for now. In the following, we discuss some of the additions that come with C23. At the end, section C.7, we will report on a project for Linux systems that you can use temporarily until your C implementation provides full support for the library parts of C23.
C.1 Functions borrowed from POSIX or similar systems
The following functions are harmonized with POSIX:
strftime
gmtime_r
localtime_r
memccpy
strdup
strndup
So, if you are on such a system (such as Linux or macOS) or program in a compatible environment, you should already have these functions. Another candidate for a function you will most likely already find on such systems is timegm
.
C.2 Improved UTF-8 support
C23 provides the new functions mbrtoc8
and c8rtomb
that have a similar role as, for example, mbrtoc32
and c32rtomb
, only that they use UTF-8 instead of UTF-32. If you are among the more experienced readers, implementing these interfaces would, in fact, be a very good exercise. UTF-8 is a really nice and sophisticated coding scheme that would teach you a lot, and correctly implementing these functions has the right level of challenge in terms of programming and in terms of understanding an international standard.