Prompted by the recent attempt[1] to fix an obstack-related bug[2] in glibc, a bug that was already fixed in Gnulib, I have attempted to make the Gnulib code usable in glibc without changing the glibc ABI and with the most-innocuous changes to the undocumented part of the glibc API, and installed the following patches into Gnulib. The eventual goal is to copy the resulting obstack.in.h and obstack.c byte-for-byte into glibc's obstack.h and obstack.c.
[1]: https://patchwork.sourceware.org/project/glibc/patch/20250429034253.3409632-3-collin.fu...@gmail.com/ [2]: https://sourceware.org/bugzilla/show_bug.cgi?id=32393 Paul Eggert (19): obstack: fix unlikely buffer overrun in glibc obstack: stop depending on alignof obstack: merge better with glibc obstack: change license wording obstack: define PTR_INT_TYPE obstack: use presence of uintptr_t obstack: use int where glibc does obstack: rename to _OBSTACK_CHUNK_SIZE_T obstack: size_t → _OBSTACK_CHUNK_SIZE_T * lib/obstack.in.h: Move <string.h> include. obstack: use glibc’s temp slot names obstack: _obstack_free → __obstack_free obstack: be more like glibc in return values obstack: be more like glibc for __extension__ libc-config, obstack: Oracle __extension__ support obstack: fix undefined behavior if big alignment obstack: use signed chunk sizes obstack: simplify default size, alignment obstack: match obstack.c with glibc ChangeLog | 131 +++++++++++++++++++++++++++++ lib/cdefs.h | 2 +- lib/obstack.c | 188 +++++++++++++++++++++++++----------------- lib/obstack.in.h | 210 ++++++++++++++++++++++++++--------------------- m4/obstack.m4 | 23 +----- modules/obstack | 5 +- 6 files changed, 369 insertions(+), 190 deletions(-) -- 2.49.0