libc: Add strfromd, strfromf, and strfroml per C23

strfromd(), strfromf(), and strfroml() are implemented directly
in terms of gdtoa.  If a non-conforming format string is passed,
the string "EDOOFUS" is returned and errno set to EDOOFUS as an
extension.

Reviewed by:	fuz
MFC after:	1 month
Pull-Request:	https://github.com/freebsd/freebsd-src/pull/2301
Signed-off-by:	Faraz Vahedi <[email protected]>
This commit is contained in:
Faraz Vahedi authored and Robert Clausecker committed 2026-08-02 14:10:02 +02:00
1 parent ae417b3194
commit f68d7bfc14
11 files changed
+1363 -1

No files matched your search

+4
View File
@@ -175,6 +175,10 @@ _Noreturn void
size_t memalignment(const void *) __pure2;
void free_sized(void *, size_t) __noexcept;
void free_aligned_sized(void *, size_t, size_t) __noexcept;
int strfromd(char * __restrict, size_t, const char * __restrict, double);
int strfromf(char * __restrict, size_t, const char * __restrict, float);
int strfroml(char * __restrict, size_t,
const char * __restrict, long double);
#endif /* __ISO_C_VISIBLE >= 2023 */
/*