string functions for freestanding implementations.
This makes most of the functionality from string.h mandatory for freestanding implementations.
Many string functions are commonly used, and most can be easily implemented. However, since they are not mandatory for freestanding implementtions, programs using them are not fully portable. However, most frestanding implementations already provide these functions (as witnessed by the widespread use of the Dhrystone benchmark for small embedded systems, which uses string functions).
The only functions from string.h that might be hard to implement on some systems are those that require dynamic memory or only make sense for locales. But even those could be implemented as stubs (i.e. always behaving as if out of memory and the locale-specific variants always behaving like the non-locale specific ones).
The Small Device C Compiler (SDCC) is a rather simple freestanding C implementation, that targets small devices, such as the Padauk PMS15A microcontroller (about 0.01€ each when bought in quantities of 10, 64 B RAM, 0.5 KW of 13-bit program memory, an 8-bit accumulator as the only register suitable for storing general data). It implements the full set of string.h functions from the N2479 draft. This shows that the string.h functions can easily be implemented efficiently even for tiny devices.
Proposed change: §4p6: Add "string.h" to the list of headers freestanding implementations need to provide.
Proposed change: §4p6: Add "string.h" to the list of headers freestanding implementations need to provide. And add the sentence "Notwithstanding the above, a conforming freestanding implementation is not required to provide the following functions from string.h: strdup, strndup, strcoll, strxfrm"
just before the last senetnce "A conforming implementation may have additional […]".