1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

Add C2X _PRINTF_NAN_LEN_MAX

C2X adds a macro _PRINTF_NAN_LEN_MAX to <stdio.h>, giving the maximum
length of printf output for a NaN.  glibc never includes an
n-char-sequence in its printf output for NaNs, so the correct value
for glibc is 4 ("-nan" or "-NAN"); define the macro accordingly.

This patch makes the macro definition conditional on __GLIBC_USE
(ISOC2X), as is generally done with features from new standard
versions.  The name is in the implementation namespace for older
standards, so it would also be possible to define it unconditionally.

Tested for x86_64.
This commit is contained in:
Joseph Myers
2021-09-30 20:53:34 +00:00
parent 52c057e37c
commit 01d34e934a
3 changed files with 12 additions and 1 deletions

View File

@@ -133,6 +133,12 @@ typedef __fpos64_t fpos64_t;
#include <bits/stdio_lim.h>
#if __GLIBC_USE (ISOC2X)
/* Maximum length of printf output for a NaN. */
# define _PRINTF_NAN_LEN_MAX 4
#endif
/* Standard streams. */
extern FILE *stdin; /* Standard input stream. */
extern FILE *stdout; /* Standard output stream. */