aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2025-04-14libio: Synthesize ESPIPE error if lseek returns 0 after reading bytesFlorian Weimer1-0/+1
This is required so that fclose, when trying to seek to the right position after filling the input buffer, does not fail with EINVAL. This fclose code path only ignores ESPIPE errors. Reported by Petr Pisar on <https://bugzilla.redhat.com/show_bug.cgi?id=2358265>. Fixes commit be6818be31e756398e45f70e2819d78be0961223 ("Make fclose seek input file to right offset (bug 12724)"). Reviewed-by: Frédéric Bérat <fberat@redhat.com>
2025-04-02stdio: fix hurd link for tst-setvbuf2DJ Delorie1-1/+2
2025-04-01stdio: Add more setvbuf testsDJ Delorie1-1/+9
2025-03-28stdio-common: Add tests for formatted vsscanf input specifiersMaciej W. Rozycki1-1/+1
Wire vsscanf into test infrastructure for formatted scanf input specifiers. Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-28stdio-common: Add tests for formatted vfscanf input specifiersMaciej W. Rozycki1-1/+1
Wire vfscanf into test infrastructure for formatted scanf input specifiers. Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-28stdio-common: Add tests for formatted vscanf input specifiersMaciej W. Rozycki1-1/+1
Wire vscanf into test infrastructure for formatted scanf input specifiers. Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-28stdio-common: Add tests for formatted sscanf input specifiersMaciej W. Rozycki1-1/+1
Wire sscanf into test infrastructure for formatted scanf input specifiers. Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-28stdio-common: Add tests for formatted fscanf input specifiersMaciej W. Rozycki1-1/+1
Wire fscanf into test infrastructure for formatted scanf input specifiers. Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-25stdio-common: Add tests for formatted scanf input specifiersMaciej W. Rozycki1-0/+60
Add a collection of tests for formatted scanf input specifiers covering the b, d, i, o, u, x, and X integer conversions, the a, A, e, E, f, F, g, and G floating-point conversions, and the [, c, and s character conversions. Also the hh, h, l, and ll length modifiers are covered with the integer conversions as are the l and L length modifier with the floating-point conversions. The tests cover assignment suppressing and the field width as well, verifying the number of assignments made, the number of characters consumed and the value assigned. Add the common test code here as well as test cases for scanf, and then base Makefile infrastructure plus target-agnostic input data, for the character conversions and the `char', `short', and `long long' integer ones, signed and unsigned, with remaining input data and other functions from the scanf family deferred to subsequent additions. Keep input data disabled and referring to BZ #12701 for entries that are currently incorrectly accepted as valid data, such as '0b' or '0x' with the relevant integer conversions or sequences of an insufficient number of characters with the c conversion. Reviewed-by: Joseph Myers <josmyers@redhat.com>
2025-03-13elf: Canonicalize $ORIGIN in an explicit ld.so invocation [BZ 25263]Adhemerval Zanella1-0/+3
When an executable is invoked directly, we calculate $ORIGIN by calling readlink on /proc/self/exe, which the Linux kernel resolves to the target of any symlinks. However, if an executable is run through ld.so, we cannot use /proc/self/exe and instead use the path given as an argument. This leads to a different calculation of $ORIGIN, which is most notable in that it causes ldd to behave differently (e.g., by not finding a library) from directly running the program. To make the behavior consistent, take advantage of the fact that the kernel also resolves /proc/self/fd/ symlinks to the target of any symlinks in the same manner, so once we have opened the main executable in order to load it, replace the user-provided path with the result of calling readlink("/proc/self/fd/N"). (On non-Linux platforms this resolution does not happen and so no behavior change is needed.) The __fd_to_filename requires _fitoa_word and _itoa_word, which for 32-bits pulls a lot of definitions from _itoa.c (due _ITOA_NEEDED being defined). To simplify the build move the required function to a new file, _fitoa_word.c. Checked on x86_64-linux-gnu and i686-linux-gnu. Co-authored-by: Geoffrey Thomas <geofft@ldpreload.com> Reviewed-by: Geoffrey Thomas <geofft@ldpreload.com> Tested-by: Geoffrey Thomas <geofft@ldpreload.com>
2025-01-28Add test of input file flushing / offset issuesJoseph Myers1-0/+1
Having fixed several bugs relating to flushing of FILE* streams (with fflush and other operations) and their offsets (both the file position indicator in the FILE*, and the offset in the underlying open file description), especially after ungetc but not limited to that case, add a test that more systematically covers different combinations of cases for such issues, with 57220 separate scenarios tested (which include examples of all the five separate fixed bugs), all of which pass given the five previous bug fixes. Tested for x86_64.
2025-01-28Fix fflush handling for mmap files after ungetc (bug 32535)Joseph Myers1-0/+1
As discussed in bug 32535, fflush fails on files opened for reading using mmap after ungetc. Fix the logic to handle this case and still compute the file offset correctly. Tested for x86_64.
2025-01-28Fix fseek handling for mmap files after ungetc or fflush (bug 32529)Joseph Myers1-0/+1
As discussed in bug 32529, fseek fails on files opened for reading using mmap after ungetc. The implementation of fseek for such files has an offset computation that's also incorrect after fflush. A combined fix addresses both problems (with tests for both included as well) and it seems reasonable to consider them a single bug. Tested for x86_64.
2025-01-28Make fflush (NULL) flush input files (bug 32369)Joseph Myers1-0/+1
As discussed in bug 32369 and required by POSIX, the POSIX feature fflush (NULL) should flush input files, not just output files. The POSIX requirement is that "fflush() shall perform this flushing action on all streams for which the behavior is defined above", and the definition for input files is for "a stream open for reading with an underlying file description, if the file is not already at EOF, and the file is one capable of seeking". Implement this requirement in glibc. (The underlying flushing implementation is what deals with avoiding errors for seeking on an unseekable file.) Tested for x86_64.
2025-01-28Make fclose seek input file to right offset (bug 12724)Joseph Myers1-0/+1
As discussed in bug 12724 and required by POSIX, before an input file (based on an underlying seekable file descriptor) is closed, fclose is sometimes required to seek that file descriptor to the correct offset, so that any other file descriptors sharing the underlying open file description are left at that offset (as a motivating example, a script could call a sequence of commands each of which processes some data from (seekable) stdin using stdio; fclose needs to do this so that each successive command can read exactly the data not handled by previous commands), but glibc fails to do this. The precise POSIX wording has changed a few times; in the 2024 edition it's "If the file is not already at EOF, and the file is one capable of seeking, the file offset of the underlying open file description shall be set to the file position of the stream if the stream is the active handle to the underlying file description.". Add appropriate logic to _IO_new_file_close_it to handle this case. I haven't made any attempt to test or change things in this area for the "old" functions. Note that there was a previous attempt to fix bug 12724, reverted in commit eb6cbd249f4465b01f428057bf6ab61f5f0c07e3. The fix version here addresses the original test in that bug report without breaking the one given in a subsequent comment in that bug report (which works with glibc before the patch, but maybe was broken by the original fix that was reverted). The logic here tries to take care not to seek the file, even to its newly computed current offset, if at EOF / possibly not the active handle; even seeking to the current offset would be problematic because of a potential race (fclose computes the current offset, another thread or process with the active handle does its own seek, fclose does a seek (not permitted by POSIX in this case) that loses the effect of the seek on the active handle in another thread or process). There are tests included for various cases of being or not being the active handle, though there aren't tests for the potential race condition. Tested for x86_64.
2025-01-28Fix fflush after ungetc on input file (bug 5994)Joseph Myers1-0/+1
As discussed in bug 5994 (plus duplicates), POSIX requires fflush after ungetc to discard pushed-back characters but preserve the file position indicator. For this purpose, each ungetc decrements the file position indicator by 1; it is unspecified after ungetc at the start of the file, and after ungetwc, so no special handling is needed for either of those cases. This is fixed with appropriate logic in _IO_new_file_sync. I haven't made any attempt to test or change things in this area for the "old" functions; the case of files using mmap is addressed in a subsequent patch (and there seem to be no problems in this area with files opened with fmemopen). Tested for x86_64.
2025-01-28libio: Add a new fwrite test that evaluates partial writesTulio Magno Quites Machado Filho1-0/+1
Test if the file-position is correctly updated when fwrite tries to flush its internal cache but is not able to completely write all items. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-01-28libio: Start to return errors when flushing fwrite's buffer [BZ #29459]Tulio Magno Quites Machado Filho1-0/+7
When an error happens, fwrite is expected to return a value that is less than nmemb. If this error happens while flushing its internal buffer, fwrite is in a complex scenario: all the data might have been written to the buffer, indicating a successful copy, but the buffer is expected to be flushed and it was not. POSIX.1-2024 states the following about errors on fwrite: If an error occurs, the resulting value of the file-position indicator for the stream is unspecified. The fwrite() function shall return the number of elements successfully written, which may be less than nitems if a write error is encountered. With that in mind, this commit modifies _IO_new_file_write in order to return the total number of bytes written via the file pointer. It also modifies fwrite in order to use the new information and return the correct number of bytes written even when sputn returns EOF. Add 2 tests: 1. tst-fwrite-bz29459: This test is based on the reproducer attached to bug 29459. In order to work, it requires to pipe stdout to another process making it hard to reuse test-driver.c. This code is more specific to the issue reported. 2. tst-fwrite-pipe: Recreates the issue by creating a pipe that is shared with a child process. Reuses test-driver.c. Evaluates a more generic scenario. Co-authored-by: Florian Weimer <fweimer@redhat.com> Reviewed-by: DJ Delorie <dj@redhat.com>
2025-01-28Add new tests for fopenMartin Coufal1-0/+1
Adding some basic tests for fopen, testing different modes, stream positioning and concurrent read/write operation on files. Reviewed-by: DJ Delorie <dj@redhat.com>
2025-01-26testsuite: Make stdio-common/tst-printf-format-*-mem UNSUPPORTED if the ↵Xi Ruoyao1-2/+5
mtrace output does not exist When gawk was not built with MPFR, there's no mtrace output and those tests FAIL. But we should make them UNSUPPORTED like other tst-printf-format-* tests in the case. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Sam James <sam@gentoo.org> Reviewed-by: Andreas K Hüttel <dilfridge@gentoo.org>
2025-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert1-1/+1
2024-12-24stdio-common: Tweak comment in MakefileSam James1-3/+3
Followup to 5a96da210c15e18c3c5298dc23a9e2e57691b6c6.
2024-12-24stdio-common: Use clang with bugfix for bug28Dmitry Chestnykh1-4/+4
The issue that was the cause of hang was fixed in upstream. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-23stdio-common: Suppress Clang warnings on scanf13.cH.J. Lu1-0/+2
Suppress Clang warnings on stdio-common/scanf13.c: 1. Before this commit: scanf13.c:43:17: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 43 | "A%mS%10mls%4ml[bcd]%4mCB", &lsp1, &lsp2, &lsp3, &lsp4) != 4) | ~~~~^ scanf13.c:43:22: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 43 | "A%mS%10mls%4ml[bcd]%4mCB", &lsp1, &lsp2, &lsp3, &lsp4) != 4) | ~~~~^ scanf13.c:43:50: error: data argument not used by format string [-Werror,-Wformat-extra-args] 43 | "A%mS%10mls%4ml[bcd]%4mCB", &lsp1, &lsp2, &lsp3, &lsp4) != 4) | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ scanf13.c:145:27: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 145 | if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) | ~~~~~~^ scanf13.c:145:31: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 145 | if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) | ~~~^ scanf13.c:145:43: error: data argument not used by format string [-Werror,-Wformat-extra-args] 145 | if (sscanf (buf, "%2048mls%mlc", &lsp3, &lsp4) != 2) | ~~~~~~~~~~~~~~ ^ scanf13.c:161:31: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 161 | if (sscanf (buf, "%4mC%1500ml[dr/]%548ml[abc/d]%3mlc", | ~~~~~~^ scanf13.c:161:42: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 161 | if (sscanf (buf, "%4mC%1500ml[dr/]%548ml[abc/d]%3mlc", | ~~~~~~~~~~^ scanf13.c:161:53: error: invalid conversion specifier 'l' [-Werror,-Wformat-invalid-specifier] 161 | if (sscanf (buf, "%4mC%1500ml[dr/]%548ml[abc/d]%3mlc", | ~~~~~~~~~~^ scanf13.c:162:15: error: data argument not used by format string [-Werror,-Wformat-extra-args] 161 | if (sscanf (buf, "%4mC%1500ml[dr/]%548ml[abc/d]%3mlc", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 162 | &lsp1, &lsp2, &lsp3, &lsp4) != 4) | ^ 10 errors generated. 2. With DIAG_IGNORE_NEEDS_COMMENT_CLANG changes in stdio-common/scanf13.c: scanf13.c:28:40: error: 'sscanf' may overflow; destination buffer in argument 4 has size 8, but the corresponding specifier may require size 11 [-Werror,-Wfortify-source] 28 | "A%ms%10ms%4m[bcd]%4mcB", &sp1, &sp2, &sp3, &sp4) != 4) | ^ scanf13.c:94:34: error: 'sscanf' may overflow; destination buffer in argument 3 has size 8, but the corresponding specifier may require size 2049 [-Werror,-Wfortify-source] 94 | if (sscanf (buf, "%2048ms%mc", &sp3, &sp4) != 2) | ^ scanf13.c:110:61: error: 'sscanf' may overflow; destination buffer in argument 4 has size 8, but the corresponding specifier may require size 1501 [-Werror,-Wfortify-source] 110 | if (sscanf (buf, "%4mc%1500m[dr/]%548m[abc/d]%3mc", &sp1, &sp2, &sp3, &sp4) | ^ scanf13.c:110:67: error: 'sscanf' may overflow; destination buffer in argument 5 has size 8, but the corresponding specifier may require size 549 [-Werror,-Wfortify-source] 110 | if (sscanf (buf, "%4mc%1500m[dr/]%548m[abc/d]%3mc", &sp1, &sp2, &sp3, &sp4) | ^ 4 errors generated. Co-Authored-By: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-21stdio-common: Exclude bug28 when clang is usedH.J. Lu1-1/+10
Clang 19 takes a very long time, it ran more than 27 minutes on Intel Core i7-1195G7 before the process was killed, to compile bug28.c: https://github.com/llvm/llvm-project/issues/120462 Exclude it when Clang is used for testing. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-17ungetc: Guarantee single char pushbackSiddhesh Poyarekar1-0/+2
The C standard requires that ungetc guarantees at least one pushback, but the malloc call to allocate the pushback buffer could fail, thus violating that requirement. Fix this by adding a single byte pushback buffer in the FILE struct that the pushback can fall back to if malloc fails. The side-effect is that if the initial malloc fails and the 1-byte fallback buffer is used, future resizing (if it succeeds) will be 2-bytes, 4-bytes and so on, which is suboptimal but it's after a malloc failure, so maybe even desirable. A future optimization here could be to have the pushback code use the single byte buffer first and only fall back to malloc for subsequent calls. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Maciej W. Rozycki <macro@redhat.com>
2024-11-07stdio-common: Add tests for formatted vsnprintf output specifiersMaciej W. Rozycki1-1/+1
Wire vsnprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted vsprintf output specifiersMaciej W. Rozycki1-1/+1
Wire vsprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted vfprintf output specifiersMaciej W. Rozycki1-1/+1
Wire vfprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted vdprintf output specifiersMaciej W. Rozycki1-1/+1
Wire vdprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted vasprintf output specifiersMaciej W. Rozycki1-1/+1
Wire vasprintf into test infrastructure for formatted printf output specifiers. Owing to mtrace logging these tests take amounts of time to complete similar to those of corresponding asprintf tests, so set timeouts for the tests accordingly, with a global default for all the vasprintf tests, and then individual higher settings for double and long double tests each. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted vprintf output specifiersMaciej W. Rozycki1-1/+1
Wire vprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted snprintf output specifiersMaciej W. Rozycki1-1/+1
Wire snprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted sprintf output specifiersMaciej W. Rozycki1-1/+1
Wire sprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted fprintf output specifiersMaciej W. Rozycki1-1/+1
Wire fprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted dprintf output specifiersMaciej W. Rozycki1-1/+1
Wire dprintf into test infrastructure for formatted printf output specifiers. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted asprintf output specifiersMaciej W. Rozycki1-1/+1
Wire asprintf into test infrastructure for formatted printf output specifiers. Owing to mtrace logging of lots of memory allocation calls these tests take a considerable amount of time to complete, except for the character conversion, taking from 00m20s for 'tst-printf-format-as-s --direct s', through 01m10s and 03m53s for 'tst-printf-format-as-char --direct i' and 'tst-printf-format-as-double --direct f' respectively, to 19m24s for 'tst-printf-format-as-ldouble --direct f', all in standalone execution from NFS on a RISC-V FU740@1.2GHz system and with output redirected over 100Mbps network via SSH. It is with the skeleton's stub implementation of dladdr(3); execution times with regular dladdr(3) are up to over twice longer. Set timeouts for the tests accordingly then, with a global default for all the asprintf tests, and then individual higher settings for double and long double tests each. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-11-07stdio-common: Add tests for formatted printf output specifiersMaciej W. Rozycki1-0/+52
This is a collection of tests for formatted printf output specifiers covering the d, i, o, u, x, and X integer conversions, the e, E, f, F, g, and G floating-point conversions, the c character conversion, and the s string conversion. Also the hh, h, l, and ll length modifiers are covered with the integer conversions as is the L length modifier with the floating-point conversions. The -, +, space, #, and 0 flags are iterated over, as permitted by the conversion handled, in tuples of 1..5, including tuples with repetitions of 2, and combined with field width and/or precision, again as permitted by the conversion. The resulting format string is then used to produce output from respective sets of input data corresponding to the specific conversion under test. POSIX extensions beyond ISO C are not used. Output is produced in the form of records which include both the format string (and width and/or precision where given in the form of separate arguments) and the conversion result, and is verified with GNU AWK using the format obtained from each such record against the reference value also supplied, relying on the fact that GNU AWK has its own independent implementation of format processing, striving to be ISO C compatible. In the course of implementation I have determined that in the non-bignum mode GNU AWK uses system sprintf(3) for the floating-point conversions, defeating the objective of doing the verification against an independent implementation. Additionally the bignum mode (using MPFR) is required to correctly output wider integer and floating-point data. Therefore for the conversions affected the relevant shell scripts sanity-check AWK and terminate with unsupported status if the bignum mode is unavailable for floating-point data or where data is output incorrectly. The f and F floating-point conversions are build-time options for GNU AWK, depending on the environment, so they are probed for before being used. Similarly the a and A floating-point conversions, however they are currently not used, see below. Also GNU AWK does not handle the b or B integer conversions at all at the moment, as at 5.3.0. Support for the a, A, b, and B conversions can however be easily added following the approach taken for the f and F conversions. Output produced by gawk for the a and A floating-point conversions does not match one produced by us: insufficient precision is used where one hasn't been explicitly given, e.g. for the negated maximum finite IEEE 754 64-bit value of -1.79769313486231570814527423731704357e+308 and "%a" format we produce -0x1.fffffffffffffp+1023 vs gawk's -0x1.000000p+1024 and a different exponent is chosen otherwise, such as with "%.a" where we output -0x2p+1023 vs gawk's -0x1p+1024 for the same value, or "%.20a" where -0x1.fffffffffffff0000000p+1023 is our output, but gawk produces -0xf.ffffffffffff80000000p+1020 instead. Consequently I chose not to include a and A conversions in testing at this time. And last but not least there are numerous corner cases that GNU AWK does not handle correctly, which are worked around by explicit handling in the AWK script. These are in particular: - extraneous leading 0 produced for the alternative form with the o conversion, e.g. { printf "%#.2o", 1 } produces "001" rather than "01", - unexpected 0 produced where no characters are expected for the input of 0 and the alternative form with the precision of 0 and the integer hexadecimal conversions, e.g. { printf "%#.x", 0 } produces "0" rather than "", - missing + character in the non-bignum mode only for the input of 0 with the + flag, precision of 0 and the signed integer conversions, e.g. { printf "%+.i", 0 } produces "" rather than "+", - missing space character in the non-bignum mode only for the input of 0 with the space flag, precision of 0 and the signed integer conversions, e.g. { printf "% .i", 0 } produces "" rather than " ", - for released gawk versions of up to 4.2.1 missing - character for the input of -NaN with the floating-point conversions, e.g. { printf "%e", "-nan" }' produces "nan" rather than "-nan", - for released gawk versions from 5.0.0 onwards + character output for the input of -NaN with the floating-point conversions, e.g. { printf "%e", "-nan" }' produces "+nan" rather than "-nan", - for released gawk versions from 5.0.0 onwards + character output for the input of Inf or NaN in the absence of the + or space flags with the floating-point conversions, e.g. { printf "%e", "inf" }' produces "+inf" rather than "inf", - for released gawk versions of up to 4.2.1 missing + character for the input of Inf or NaN with the + flag and the floating-point conversions, e.g. { printf "%+e", "inf" }' produces "inf" rather than "+inf", - for released gawk versions of up to 4.2.1 missing space character for the input of Inf or NaN with the space flag and the floating-point conversions, e.g. { printf "% e", "nan" }' produces "nan" rather than " nan", - for released gawk versions from 5.0.0 onwards + character output for the input of Inf or NaN with the space flag and the floating-point conversions, e.g. { printf "% e", "inf" }' produces "+inf" rather than " inf", - for released gawk versions from 5.0.0 onwards the field width is ignored for the input of Inf or NaN and the floating-point conversions, e.g. { printf "%20e", "-inf" }' produces "-inf" rather than " -inf", NB for released gawk versions of up to 4.2.1 floating-point conversion issues apply to the bignum mode only, as in the non-bignum mode system sprintf(3) is used. As from version 5.0.0 specialized handling has been added for [-]Inf and [-]NaN inputs and the issues listed apply to both modes. The '--posix' flag makes gawk versions from 5.0.0 onwards avoid the issue with field width and the + character unconditionally output for the input of Inf or NaN, however not the remaining issues and then the 'gensub' function is not supported in the POSIX mode, so to go this path I deemed not worth it. Each test completes within single seconds except for the long double one. There the F/f formats produce a large number of digits, which appears to be computationally intensive and CPU-bound. Standalone execution time for 'tst-printf-format-p-ldouble --direct f' is in the range of 00m36s for POWER9@2.166GHz and 09m52s for FU740@1.2GHz and output redirected locally to /dev/null, and 10m11s for FU740 and output redirected over 100Mbps network via SSH to /dev/null, so the throughput of the network adds very little (~3.2% in this case) to the processing time. This is with IEEE 754 quad. So I have scaled the timeout for 'tst-printf-format-skeleton-ldouble' accordingly. Regardless, following recent practice the test has been added to the standard rather than extended set. However, unlike most of the remaining tests it has been split by the conversion specifier, so as to allow better parallelization of this long-