From: Adhemerval Zanella Date: Sat, 6 Sep 2025 22:21:35 +0000 (-0300) Subject: malloc: Fix Os build on some ABIs X-Git-Tag: glibc-2.43~572 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9fe06a8a8f2ef93981a553707bbb7aa19d2601b;p=thirdparty%2Fglibc.git malloc: Fix Os build on some ABIs I have not checked with all versions for all ABIs, but I saw failures with gcc-14 on arm, alpha, hppa, i686, sparc, sh4, and microblaze. Reviewed-by: Collin Funk --- diff --git a/malloc/malloc.c b/malloc/malloc.c index 6c02af5a27..444dc61825 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -3305,10 +3305,16 @@ tcache_get_align (size_t nb, size_t alignment) mangled = true; } + /* GCC compiling for -Os warns on some architectures that csize may be + uninitialized. However, if 'te' is not NULL, csize is always + initialized in the loop above. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_Os_NEEDS_COMMENT (12, "-Wmaybe-uninitialized"); if (te != NULL && csize == nb && PTR_IS_ALIGNED (te, alignment)) return tag_new_usable (tcache_get_n (tc_idx, tep, mangled)); + DIAG_POP_NEEDS_COMMENT; } return NULL; }