From 9748dc45ec242476fcb8567e34612b996134454c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 1 Aug 2026 09:07:35 +0200 Subject: [PATCH] free-posix tests: Avoid failure on Ubuntu 24.04 (regression 2026-07-28). * tests/test-free.c (main): Restore previous code for !__FILC__. --- ChangeLog | 5 +++++ tests/test-free.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 -- 2.47.3