On Tue, Feb 22, 2005 at 11:39:42AM -0800, Ben Pfaff wrote:

[deletia]

> The documentation for AC_MALLOC_FUNC in the autoconf manual shows
> you what replacement you should provide:
> 
>      #if HAVE_CONFIG_H
>      # include <config.h>
>      #endif
>      #undef malloc
>      
>      #include <sys/types.h>
>      
>      void *malloc ();
>      
>      /* Allocate an N-byte block of memory from the heap.
>         If N is zero, allocate a 1-byte block.  */
>      
>      void *
>      rpl_malloc (size_t n)
>      {
>        if (n == 0)
>          n = 1;
>        return malloc (n);
>      }

This isn't a reasonable solution when cross compiling.  Adding code to
a complex package, especially when there are many packages in a
project, is prohibitive.

Paul Eggert made the reasonable suggestion that defining the macro
ahead of time, in the environment, bypasses the configuration scripts
logic to force replacement of malloc.  A much better solution than
adding code

  export ac_cv_func_malloc_0_nonnull=yes

Cheers.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to