Re: [PATCH 1/3] tests: suppress some unwanted -fanalyzer checking

2023-04-24 Thread Bruno Haible
Paul Eggert wrote: > Unless I'm misunderstanding you things should work as-is, as > manywarnings should omit a -Wxxx option if gcc complains that it's not > supported. It could be that a warning option is accepted by the front-end's option parser, but unknown to the #pragma handler. > And anywa

Re: [PATCH 1/3] tests: suppress some unwanted -fanalyzer checking

2023-04-24 Thread Paul Eggert
On 4/24/23 15:20, Bruno Haible wrote: This patch fixes them. Thanks for catching that; I had been testing only with GCC 13 and looking at the GCC doc (evidently incorrectly) for the GCC version. since it's not possible to silence these diagnostics with GCC 10, 11, 12, if you don't want them

[PATCH 2/3] unsetenv-tests: pacify -Wanalyzer-putenv-of-auto-var

2023-04-24 Thread Paul Eggert
* tests/test-unsetenv.c (main): Make entry static. Even with this change, it’s unclear whether this test is portable POSIX code, but that’s a different matter. --- ChangeLog | 5 + tests/test-unsetenv.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeL

[PATCH 1/3] tests: suppress some unwanted -fanalyzer checking

2023-04-24 Thread Paul Eggert
* tests/test-dup2.c, tests/test-fcntl.c, tests/test-fopen.h: * tests/test-getdtablesize.c, tests/test-listen.c: * tests/test-localename.c, tests/test-open.h, tests/test-perror2.c: * tests/test-select.h: Add pragmas to disable unwanted -fanalyzer checking. --- ChangeLog | 9 +++

[PATCH 3/3] fclose: pacify gcc -Wanalyzer-file-leak

2023-04-24 Thread Paul Eggert
Without this patch, building coreutils with --enable-gcc-checking=expensive would fail with a message like “lib/exclude.c:682:6: error: leak of FILE 'in' [CWE-775] [-Werror=analyzer-file-leak]”, because Gnulib replaced fclose but not fopen, and GCC saw a call to fopen followed by a call to rpl_fclo

select, pselect: Fix test failure on native Windows

2023-04-24 Thread Bruno Haible
On native Windows, I see two test failures: FAIL: test-pselect == Invalid nfd test... failed (invalid errno after negative nfds) Invalid fd test... passed Unconnected socket test... passed Connected sockets test... passed General socket test with fork... passed Pipe test... passed

ftell, ftello: Fix recognition of pipes on native Windows

2023-04-24 Thread Bruno Haible
ftell() and ftello() must fail when the stream refers to a pipe, says POSIX . Likewise for fgetpos() . Gnulib checks this for ftell() and ftello(). These

lseek: Fix module dependencies

2023-04-24 Thread Bruno Haible
On 2021-11-15 a change was made to optimize the conditions of the module dependencies of 'lseek'. Such optimizations are often hairy, because they assume that the workaround is only needed in the _currently known_ circumstances. In this case, the optimization was also wrong, because the dependency

system-quote: Fix memory overrun bug on native Windows

2023-04-24 Thread Bruno Haible
On native Windows, I sometimes see the test-system-quote.sh test fail, with exit code 127 and no other details. The cause is a memory overrun bug, present since the beginning of this module. This patch fixes it. 2023-04-24 Bruno Haible system-quote: Fix memory overrun bug on native

unicodeio tests: Avoid test failures on native Windows

2023-04-24 Thread Bruno Haible
On native Windows, I see a failure of a 'unicodeio' test: FAIL: test-unicodeio1.sh ../../gltests/test-unicodeio.c:67: assertion 'strcmp (result, TEST_CODE_AS_UTF8) == 0' failed FAIL test-unicodeio1.sh (exit status: 3) The reason is that the encoding of the C locale happ

*sprintf tests: Avoid test failures on mingw 10

2023-04-24 Thread Bruno Haible
On mingw 10.0.0, I see these test failures: FAIL: test-snprintf-posix = ../../gltests/test-snprintf-posix.h:3193: assertion 'strcmp (result, "000303c 33") == 0' failed FAIL test-snprintf-posix.exe (exit status: 3) FAIL: test-sprintf-posix