[PATCH] malloc: fix undefined behavior in obstack.h [BZ #32393]
Collin Funk
collin.funk1@gmail.com
Tue Apr 29 18:21:59 GMT 2025
Paul Eggert <eggert@cs.ucla.edu> writes:
> Let's call this new macro __PTR_UINT_TYPE instead, to avoid namespace
> pollution.
I didn't like adding PTR_UINT_TYPE, but it seemed better than including
an entire header.
Using __PTR_UINT_TYPE is reasonable. Just slightly wonky with
PTR_INT_TYPE.
> This collides with Gnulib, which needs to do this a different way to
> avoid a compiler error with Oracle Developer Studio. Although
> admittedly it'll take a bit of work to merge with Gnulib, let's not
> make merging harder.
Right. I was 99% sure that glibc did not care about the
__SMALL_PTRDIFF_T case per the comment in obstack.m4:
dnl SMALL_PTRDIFF_T is expected to be 1 only on old / exotic platforms
dnl such as Windows 3.1 and AS/400
But wanted to be certain. Thanks for checking.
> How about the attached patch instead?
Looks good to me, thanks.
Collin
More information about the Libc-alpha
mailing list