]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
free-posix tests: Avoid failure on Ubuntu 24.04 (regression 2026-07-28). master
authorBruno Haible <bruno@clisp.org>
Sat, 1 Aug 2026 07:07:35 +0000 (09:07 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 1 Aug 2026 07:07:35 +0000 (09:07 +0200)
* tests/test-free.c (main): Restore previous code for !__FILC__.

ChangeLog
tests/test-free.c

index 927193826cd19d623a878587cc5566f9037be16d..f3fb990b6aee47a2252cf8dcb46b569df3c20eb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2026-08-01  Bruno Haible  <bruno@clisp.org>
+
+       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  <eggert@cs.ucla.edu>
 
        doc: N3322 cautions
index 7a3fa9a9aa4204c8b4f1c4e4e301fe0a3a743214..612a7afb7f4db2771fe50fd15f663553ceb091a8 100644 (file)
@@ -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