Paul Eggert wrote: > I installed the attached patch to go back to the old way of doing things, > ... > I didn't adjust the recently-added Gnulib test cases even though they're > testing what is now documented to be undefined behavior, as they still > pass on the FreeBSD and Ubuntu platforms that I tried them on.
Following your change, this test started to fail on all platforms other than glibc systems and FreeBSD. (The CI detected it.) I'm updating the test. The ASSERT (endp == NULL) succeeds on glibc systems without sanitizer, but fails on glibc systems with ASAN. Apparently the libasan replacement behaves slightly differently than the glibc function. 2024-07-29 Bruno Haible <br...@clisp.org> xstrtol, xstrtoll tests: Avoid test failure after 2024-07-25 change. * tests/test-xstrtol.c (main): Update expected test results. diff --git a/tests/test-xstrtol.c b/tests/test-xstrtol.c index 2b2b51a47e..5891f4bbfd 100644 --- a/tests/test-xstrtol.c +++ b/tests/test-xstrtol.c @@ -74,13 +74,12 @@ main (int argc, char **argv) char *endp = NULL; __strtol_t val = -17; strtol_error s_err = __xstrtol (input, &endp, -1, &val, "k"); -#if defined __FreeBSD__ +#if !defined __GLIBC__ ASSERT (s_err == LONGINT_OK); ASSERT (endp == input + 1); ASSERT (val == 1024); #else ASSERT (s_err == LONGINT_INVALID); - ASSERT (endp == NULL); ASSERT (val == -17); #endif }