Import obstack.* from gnulib

Andreas Jaeger aj@suse.de
Tue Jan 27 14:43:00 GMT 2004


Paul Eggert wrote the following:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: Ulrich Drepper <drepper@redhat.com>
> Date: Sat, 24 Jan 2004 13:33:47 -0800
> 
> > @@ -119,40 +119,22 @@ extern "C" {
> >  #endif
> >  
> >  #ifndef __INT_TO_PTR
> > -#if defined __STDC__ && __STDC__
> > -# define __INT_TO_PTR(P) ((void *) ((P) + (char *) 0))
> > -#else
> >  # define __INT_TO_PTR(P) ((P) + (char *) 0)
> >  #endif
> > -#endif
>
> Why should the K&R branch survive here?

Because the "ANSI branch" was incorrect for C++ compilation.
This problem was originally described by Alexandre Duret-Lutz in
<http://mail.gnu.org/archive/html/bug-glibc/2003-07/msg00024.html>.

The above-quoted hunk isn't complete by itself.  It's paired with the
following change to obstack_finish:

   -  __INT_TO_PTR ((h)->temp))
   +  (void *) __INT_TO_PTR ((h)->temp))

and this pair of hunks causes the resulting code to conform to C89 (as
well as to C99; and to K&R C also, not that it matters).


> Maybe there are other places like this.

No.  I didn't find any other places when I looked for them.
This was in July when I installed this patch into gnulib
<http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00020.html>.
Also, the patch worked for Alexandre, which is a test that the changes
are complete.


> From: Ulrich Drepper <drepper@redhat.com>
> Date: Sun, 25 Jan 2004 00:26:51 -0800
> 
> Andreas Jaeger wrote:
> > I suggest to import this now - and handle those changes later.  Ok?
> 
> No, why?  We don't add incomplete changes since this only means it gets
> forgotten.

Andreas, I assume that by "those changes later" you mean some other
set of changes for the "other places like this".  If I understand you
correctly, there are no "those changes".  Your email contained only
one set of changes, which are complete.  There is no K&R code in the
resulting file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So, can I commit the current version now?

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20040127/ee79f8ba/attachment.sig>


More information about the Libc-hacker mailing list