[PATCH] Use correct type for glibc.malloc.perturb in tst-tunconf1.c
Andreas K. Huettel
dilfridge@gentoo.org
Sun Jul 12 12:56:01 GMT 2026
Am Samstag, 11. Juli 2026, 01:35:30 Japanische Normalzeit schrieb DJ Delorie:
> Stefan Liebler <stli@linux.ibm.com> writes:
> > According to elf/dl-tunables.list, glibc.malloc.perturb is of type
> > int32_t (4byte) and not size_t (8byte) which was used for
> > TUNABLE_GET_FULL inside the testcase. Therefore the correct 32bit
> > value 0x2a=42 is written to the to the wrong place and leads to the
> > comparison failure.
>
> I'm wondering how it passed for me... does it only show up on MSB systems?
I only saw it on s390x too.
>
> > + printf("perturb is %d (should be 42, from /etc)\n",
> > + perturb);
>
> Do we know that %d matches int32_t on all platforms? Or should we cast
> this to (int) ?
Best I could find in a draft of the C standard floating on the internets,
in the section on fprintf %d is specified to be of type int.
Which is, to my best knowledge, 32bit everywhere we can run Linux.
>
>
--
PD Dr. Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 870 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20260712/7561e6bd/attachment.sig>
More information about the Libc-alpha
mailing list