From: Bruno Haible Date: Sat, 1 Aug 2026 07:07:35 +0000 (+0200) Subject: free-posix tests: Avoid failure on Ubuntu 24.04 (regression 2026-07-28). X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fgnulib.git free-posix tests: Avoid failure on Ubuntu 24.04 (regression 2026-07-28). * tests/test-free.c (main): Restore previous code for !__FILC__. --- diff --git a/ChangeLog b/ChangeLog index 927193826c..f3fb990b6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2026-08-01 Bruno Haible + + free-posix tests: Avoid failure on Ubuntu 24.04 (regression 2026-07-28). + * tests/test-free.c (main): Restore previous code for !__FILC__. + 2026-07-31 Paul Eggert doc: N3322 cautions diff --git a/tests/test-free.c b/tests/test-free.c index 7a3fa9a9aa..612a7afb7f 100644 --- a/tests/test-free.c +++ b/tests/test-free.c @@ -131,7 +131,12 @@ main () /* Do a large memory allocation. */ size_t big_size = 0x1000000; void *ptr = malloc (big_size - 0x100); - char *ptr_aligned = (char *) ptr - ((uintptr_t) ptr & (pagesize - 1)); + char *ptr_aligned; + #if defined __FILC__ + ptr_aligned = (char *) ptr - ((uintptr_t) ptr & (pagesize - 1)); + #else + ptr_aligned = (char *) ((uintptr_t) ptr & ~(pagesize - 1)); + #endif /* This large memory allocation allocated a memory area from ptr_aligned to ptr_aligned + big_size. Enlarge this memory area by adding a page before and a page