bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: realloc.c on Tru64 4.0D


From: Ralf Wildenhues
Subject: Re: realloc.c on Tru64 4.0D
Date: Tue, 30 Oct 2007 06:54:53 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Bruno,

* Bruno Haible wrote on Sun, Oct 28, 2007 at 04:20:42AM CET:
> Ralf Wildenhues wrote:
> > 
> > --- a/lib/realloc.c
> > +++ b/lib/realloc.c
> > @@ -23,6 +23,10 @@
> >  # define NEED_REALLOC_GNU
> >  # undef realloc
> >  #endif
> > +#ifdef malloc
> > +# define NEED_REALLOC_GNU
> > +# undef malloc
> > +#endif
> >  
> 
> This does not handle all possible cases right:
>   - If the module 'realloc' is used but the 'malloc' module is not,
>     and realloc(0) != NULL but malloc(0) == NULL, you also need 
> NEED_REALLOC_GNU.
>   - When the modules 'realloc-posix' and 'malloc' are used, but 'realloc' is 
> not,
>     there is no need to set NEED_REALLOC_GNU.
>   - NEED_REALLOC_GNU is overkill when  realloc(0) != NULL but malloc(0) == 
> NULL.
> Also, too few comments.

Pleading guilty on all accounts.  :-)

> How about this?

Looks good to me, works in a casual test on Tru64 4.0D.

Thanks!
Ralf

> 2007-10-27  Ralf Wildenhues  <address@hidden>
>             Bruno Haible  <address@hidden>
> 
>       * modules/malloc (configure.ac): Define GNULIB_MALLOC_GNU always.
>       * modules/realloc (configure.ac): Define GNULIB_REALLOC_GNU always.
>       * lib/realloc.c (SYSTEM_MALLOC_GLIBC_COMPATIBLE): New macro.
>       (malloc): Undefine also before including <stdlib.h>.
>       (rpl_realloc): Turn malloc(0) into malloc(1) if necessary.
>       Needed on OSF/1 4.0.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]