diff options
author | Joseph Myers <joseph@codesourcery.com> | 2021-09-30 20:53:34 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2021-09-30 20:53:34 +0000 |
commit | 01d34e934a395675ba3c576f2a51f10b86efbc20 (patch) | |
tree | 0c45b06458f2458671ade0c404d41527c63bfefd /manual/stdio.texi | |
parent | 52c057e37c3e0d1451f1c1cc0465eddee6cf236d (diff) | |
download | glibc-01d34e934a395675ba3c576f2a51f10b86efbc20.tar glibc-01d34e934a395675ba3c576f2a51f10b86efbc20.tar.gz glibc-01d34e934a395675ba3c576f2a51f10b86efbc20.tar.bz2 glibc-01d34e934a395675ba3c576f2a51f10b86efbc20.zip |
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.
Diffstat (limited to 'manual/stdio.texi')
-rw-r--r-- | manual/stdio.texi | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/manual/stdio.texi b/manual/stdio.texi index fd7ed0cedc..1d235be68d 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -2108,7 +2108,10 @@ If the value to be printed represents infinity or a NaN, the output is @w{[@code{-}]@code{inf}} or @code{nan} respectively if the conversion specifier is @samp{%a}, @samp{%e}, @samp{%f}, or @samp{%g} and it is @w{[@code{-}]@code{INF}} or @code{NAN} respectively if the conversion is -@samp{%A}, @samp{%E}, or @samp{%G}. +@samp{%A}, @samp{%E}, or @samp{%G}. On some implementations, a NaN +may result in longer output with information about the payload of the +NaN; ISO C2X defines a macro @code{_PRINTF_NAN_LEN_MAX} giving the +maximum length of such output. The following flags can be used to modify the behavior: |