Detect UNIX domain sockets supported by recent Windows versions.

2024-07-23 Thread Collin Funk
Windows has supported socket (AF_UNIX, SOCK_STREAM, ...) since 2017 [1]. The checks in m4/sockpfaf.m4 where written before then. I've committed this patch to support Windows. On Windows version that support it, afunix.h is a small file with the following type: typedef struct sockaddr_un {

Re: sys_socket tests: Improve tests for macro definitions.

2024-07-23 Thread Collin Funk
Collin Funk writes: > I had assumed these macros were defined since sys_socket depends on > m4/sockpfaf.m4. However, the module doesn't invoke gl_SOCKET_FAMILIES. ... Sorry, I didn't see gl_SOCKET_FAMILIES only checked IPv4 & IPv6 sockets. UNIX sockets are in gl_SOCKET_FAMILY_UNIX. One line chan

Re: sys_socket tests: Improve tests for macro definitions.

2024-07-23 Thread Collin Funk
Collin Funk writes: > * All supported AF_* constants must have distinct values. Oops. Small mistake in my test for this. I wrote: switch (0) { case AF_UNSPEC: #if HAVE_IPV4 case AF_INET: #endif #if HAVE_IPV6 case AF_INET6: #endif #if HAVE_UNIXSOCKET case AF_UNIX: #endif

sys_socket tests: Improve checks for socklen_t and sa_family_t.

2024-07-23 Thread Collin Funk
Another longstanding part of the sys/socket.h specification: * The header shall define the socklen_t type, which is an integer type of width of at least 32 bits; see APPLICATION USAGE. * The header shall define the sa_family_t unsigned integer type. On mingw I see 'typ

getopt-posix, getopt-gnu tests: Avoid test failure on mingw

2024-07-23 Thread Bruno Haible
In a testdir of getopt-posix, getopt-gnu, as well as in GNU gettext, I see these test failures on mingw: FAIL: test-getopt-gnu = ../../../gettext-tools/gnulib-tests/test-getopt.h:772: assertion 'strcmp (argv[1], "-p") == 0' failed FAIL test-getopt-gnu.exe (exit status: 3) FA

Re: xstrtod, xstrtold: proposed change

2024-07-23 Thread Paul Eggert
On 2024-07-23 12:35, Bruno Haible wrote: I propose to change the gradual underflow behaviour of xstrtod Sounds good. The current behavior with MSVC does make more sense.

xstrtod, xstrtold: proposed change

2024-07-23 Thread Bruno Haible
Hi, In the current behaviour of xstrtod: Condition RET *RESULT errno - conversion error: no number parsed false 0.0 EINVAL or 0 PTR =

xstrtod, xstrtold: Add unit tests and documentation

2024-07-23 Thread Bruno Haible
In order to understand how xstrtod and xstrtold behave, I added unit tests, then wrote the specification based on these tests. 2024-07-23 Bruno Haible xstrtod, xstrtold: Add documentation. * lib/xstrtod.h (xstrtod, xstrtold): Add comments. * lib/xstrtod.c (XSTRTOD): Im

Re: strtof, strtod, strtold: Fix underflow behaviour

2024-07-23 Thread Bruno Haible
And some more unit test tweak: 2024-07-23 Bruno Haible strtof, strtod, strtold tests: Strengthen tests. * tests/test-strtof.h (test_function): Strengthen the flush-to-zero underflow tests. * tests/test-strtod.h (test_function): Likewise. * tests/test-st

doc: Update for glibc 2.40

2024-07-23 Thread Bruno Haible
This patch updates the doc, regarding glibc 2.40. 2024-07-23 Bruno Haible doc: Update for glibc 2.40. * doc/posix-headers/utmpx.texi: Update. * doc/posix-functions/*.texi: Likewise. https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=db344dc380a8ca83ee609

strtof, strtod, strtold: Fix underflow behaviour

2024-07-23 Thread Bruno Haible
The behaviour of math functions is "specified" (or, more exactly, left to the implementation) in ISO C 23 ยง 7.12.1.(6). In the case of the strtof, strtod, strtold functions, a test program (attached: foo.c) showed that these functions show the following behaviour: * Errors are generally reporte

Re: sys_socket tests: Improve tests for macro definitions.

2024-07-23 Thread Bruno Haible
Collin Funk wrote: > Adding a few tests based on longstanding POSIX specification (i.e. not > added in 2024). > > * AF_UNSPEC should be 0. > * All supported AF_* constants must have distinct values. > * SHUT_RD, SHUT_RDWR, SHUT_WR must have distinct values. Thanks!