* lib/obstack.in.h (struct obstack): Rename temp fields back to what glibc uses, to avoid any glibc concerns about source code compatibility. All uses changed back. This affect only non-GNU-compatible compilers. --- ChangeLog | 6 ++++++ lib/obstack.in.h | 52 ++++++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 403140cdf8..3abdef82de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2025-05-05 Paul Eggert <egg...@cs.ucla.edu> + obstack: use glibc’s temp slot names + * lib/obstack.in.h (struct obstack): Rename temp fields back to + what glibc uses, to avoid any glibc concerns about source code + compatibility. All uses changed back. This affect only + non-GNU-compatible compilers. + obstack: size_t → _OBSTACK_CHUNK_SIZE_T * lib/obstack.c (_obstack_begin, _obstack_begin_1): * lib/obstack.in.h (struct obstack, obstack_init, obstack_begin) diff --git a/lib/obstack.in.h b/lib/obstack.in.h index f53b78c15c..a8f34ccfac 100644 --- a/lib/obstack.in.h +++ b/lib/obstack.in.h @@ -203,8 +203,8 @@ struct obstack /* control current object in current chunk */ char *chunk_limit; /* address of char after current chunk */ union { - _OBSTACK_SIZE_T i; - void *p; + _OBSTACK_SIZE_T tempint; + void *tempptr; } temp; /* Temporary for some macros. */ _OBSTACK_INDEX_T alignment_mask; /* Mask of alignment for each object. */ @@ -496,25 +496,25 @@ extern int obstack_exit_failure; but some compilers won't accept it. */ # define obstack_make_room(h, length) \ - ((h)->temp.i = (length), \ - ((obstack_room (h) < (h)->temp.i) \ - ? (_obstack_newchunk (h, (h)->temp.i), 0) : 0), \ + ((h)->temp.tempint = (length), \ + ((obstack_room (h) < (h)->temp.tempint) \ + ? (_obstack_newchunk (h, (h)->temp.tempint), 0) : 0), \ (void) 0) # define obstack_grow(h, where, length) \ - ((h)->temp.i = (length), \ - ((obstack_room (h) < (h)->temp.i) \ - ? (_obstack_newchunk ((h), (h)->temp.i), 0) : 0), \ - memcpy ((h)->next_free, where, (h)->temp.i), \ - (h)->next_free += (h)->temp.i, \ + ((h)->temp.tempint = (length), \ + ((obstack_room (h) < (h)->temp.tempint) \ + ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ + memcpy ((h)->next_free, where, (h)->temp.tempint), \ + (h)->next_free += (h)->temp.tempint, \ (void) 0) # define obstack_grow0(h, where, length) \ - ((h)->temp.i = (length), \ - ((obstack_room (h) <= (h)->temp.i) \ - ? (_obstack_newchunk ((h), (h)->temp.i + 1), 0) : 0), \ - memcpy ((h)->next_free, where, (h)->temp.i), \ - (h)->next_free += (h)->temp.i, \ + ((h)->temp.tempint = (length), \ + ((obstack_room (h) <= (h)->temp.tempint) \ + ? (_obstack_newchunk ((h), (h)->temp.tempint + 1), 0) : 0), \ + memcpy ((h)->next_free, where, (h)->temp.tempint), \ + (h)->next_free += (h)->temp.tempint, \ *((h)->next_free)++ = 0, \ (void) 0) @@ -542,10 +542,10 @@ extern int obstack_exit_failure; (void) 0) # define obstack_blank(h, length) \ - ((h)->temp.i = (length), \ - ((obstack_room (h) < (h)->temp.i) \ - ? (_obstack_newchunk ((h), (h)->temp.i), 0) : 0), \ - obstack_blank_fast (h, (h)->temp.i)) + ((h)->temp.tempint = (length), \ + ((obstack_room (h) < (h)->temp.tempint) \ + ? (_obstack_newchunk ((h), (h)->temp.tempint), 0) : 0), \ + obstack_blank_fast (h, (h)->temp.tempint)) # define obstack_alloc(h, length) \ (obstack_blank ((h), (length)), obstack_finish ((h))) @@ -560,7 +560,7 @@ extern int obstack_exit_failure; (((h)->next_free == (h)->object_base \ ? (((h)->maybe_empty_object = 1), 0) \ : 0), \ - (h)->temp.p = (h)->object_base, \ + (h)->temp.tempptr = (h)->object_base, \ (h)->next_free \ = __PTR_ALIGN ((h)->object_base, (h)->next_free, \ (h)->alignment_mask), \ @@ -568,14 +568,14 @@ extern int obstack_exit_failure; > (size_t) ((h)->chunk_limit - (char *) (h)->chunk)) \ ? ((h)->next_free = (h)->chunk_limit) : 0), \ (h)->object_base = (h)->next_free, \ - (h)->temp.p) + (h)->temp.tempptr) # define obstack_free(h, obj) \ - ((h)->temp.p = (void *) (obj), \ - (((h)->temp.p > (void *) (h)->chunk \ - && (h)->temp.p < (void *) (h)->chunk_limit) \ - ? (void) ((h)->next_free = (h)->object_base = (char *) (h)->temp.p) \ - : _obstack_free ((h), (h)->temp.p))) + ((h)->temp.tempptr = (void *) (obj), \ + (((h)->temp.tempptr > (void *) (h)->chunk \ + && (h)->temp.tempptr < (void *) (h)->chunk_limit) \ + ? (void) ((h)->next_free = (h)->object_base = (char *) (h)->temp.tempptr) \ + : _obstack_free ((h), (h)->temp.tempptr))) #endif /* not __GNUC__ */ -- 2.49.0