Re: filemode: Add tests.

2024-06-19 Thread Bruno Haible
Hi Collin, > I ran into a compilation error a long time ago (not Gnulib related) > because I declared strmode using the mode_t argument unconditionally. > This is an issue because FreeBSD uses int as the first argument and > not mode_t, which is typedef'd to __uint16_t. This test is mostly to > ma

u*-vasnprintf tests: Add more tests of %U, %lU, %llU directives

2024-06-19 Thread Bruno Haible
In the %ls and %U directives handling of the u*_vasnprintf functions, the width handling is tricky. Let me add some more unit tests for this code. 2024-06-19 Bruno Haible u*-vasnprintf tests: Add more tests of %U, %lU, %llU directives. * tests/unistdio/test-u8-printf1.h (test_

Re: filemode: Add tests.

2024-06-19 Thread Collin Funk
Hi Bruno, Bruno Haible wrote: >> NetBSD fixed that declaration in 1997 [1], FreeBSD did in version >> 14.0 [2]. OpenBSD still has it declared with an int argument even >> though mode_t is a __uint32_t there [3] [4] [5]. > > Also, macOS is in the same camp as OpenBSD here. I reported it with a pr

vasnprintf: some tweaks

2024-06-19 Thread Bruno Haible
Three small tweaks of the *vasnprintf code: 2024-06-19 Bruno Haible vasnwprintf: Optimize handling of %c directive. * lib/vasnprintf.c (VASNPRINTF): Use a single ENSURE_ALLOCATION instead of two. 2024-06-19 Bruno Haible u*-vasnprintf: Fix a rare memory lea

Re: filemode: Add tests.

2024-06-19 Thread Bruno Haible
Hi Collin, > > Since the test includes , it should depend on the 'unistd' > > module. Just to make sure we don't encounter a compilation error on > > native Windows. > > Ah, okay. I thought that would only be necessary if using a function > from or macros like SEEK_*, *_FILENO, etc. You can look

vasnprintf, u*-vasnprintf: Support string arguments longer than 2 GiB

2024-06-19 Thread Bruno Haible
The next step towards the *zprintf family of functions. Part of step 1 of . I added three unit tests for %s with large arguments. (You need to pass option --with-longrunning-tests to gnulib-tool, in order to include them.) Withou

filemode tests: Fix comment.

2024-06-19 Thread Collin Funk
When copying the copyright header from another file I forgot to change the file description. Oops. CollinFrom 30b5f5759d1e8a75f9b798b0c20f96734ad52e0f Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Wed, 19 Jun 2024 14:52:49 -0700 Subject: [PATCH] filemode tests: Fix comment. * tests/test-filem

Re: vasnprintf, u*-vasnprintf: Support string arguments longer than 2 GiB

2024-06-19 Thread Bruno Haible
Three more patches in this series: 1) Fix a small mistake that caused gcc warnings. 2) I measured the amount of RAM that the tests need: $ /usr/bin/time -f "Max RSS: %M KiB" ./test-...printf-big This is consistent with what I see by watching the process through "top". 3) vasnwprintf tests:

vasnprintf, u*-vasnprintf: Support huge wide string arguments

2024-06-19 Thread Bruno Haible
Still working on making vasnprintf and u*_vasnprintf able to grok arguments with more than 2^31 elements. Here: wide strings and the %ls directive. 2024-06-19 Bruno Haible vasnprintf, u*-asnprintf tests: Add test of huge %ls arguments. * tests/test-vasnprintf-big.c: Include .

Re: bug#71470: test failure on CentOS 7

2024-06-19 Thread Bruno Haible
[Ccing bug-gnulib] Collin Funk wrote: > > CentOS 7 will be supported until 2028. > > I've updated Gnulib's end-of-life.txt: > > I remember we based our Python 3.7 dependency on CentOS almost being > almost end of life [1]. Does this change anything there? Or will > installing some python-3.7 packa

Re: [bug-diffutils] bug#71535: multiple defects found by covscan in diffutils-3.10

2024-06-19 Thread Paul Eggert
On 6/13/24 05:34, Wasser Mai wrote: Error: INTEGER_OVERFLOW (CWE-190): diffutils-3.10/lib/stackvma.c:198:23: tainted_data_return: Called function ""read(fd, rof->buffer + rof->filled, size - rof->filled)"", and a possible return value may be less than zero. diffutils-3.10/lib/stackvma.c:198:23: c

Re: [bug-diffutils] bug#71535: multiple defects found by covscan in diffutils-3.10

2024-06-19 Thread Bruno Haible
Hi Paul, > I installed the attached patch into Gnulib > to fix the bug, which appears to be so unlikely that it's not worth > losing sleep over. Thanks! I've propagated it to GNU libsigsegv. > As near as I can make out, this was the only defect report by Coverity > that was not a false alarm.

vasnwprintf: Support huge wide string arguments

2024-06-19 Thread Bruno Haible
These two patches add support for wide strings with more than INT_MAX wide characters to vasnwprintf. Without the change in lib/vasnprintf.c, the underlying swprintf function is used, which always returns -1 for such arguments, and the logic in vasnprintf.c then increases the memory allocation exp