bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch


From: Bruno Haible
Subject: Re: [Bug-gnulib] Patch proposal: 1-gary-safe-xfree.patch
Date: Mon, 15 Sep 2003 19:39:25 +0200
User-agent: KMail/1.5

Paul Eggert wrote:
> I thought about it a bit more, and decided that it'd be better to use
> a solution that simply causes 'free' to work as expected in C89 or
> letter.  We shouldn't introduce yet another symbol like 'xfree'; we
> should just make 'free' work.

Fully agreed. That's a good general guideline.

> I'm also proposing changing the maintainer for the xalloc module to 'all'.
> (The actual maintainers have mostly been Bruno, Jim, and myself.)

Agreed.

> +AC_DEFUN([gl_FUNC_FREE_NULL],
> +[
> +  AC_CACHE_CHECK([whether free (NULL) is known to work],
> +    [gl_cv_func_free_null],
> +    [AC_COMPILE_IFELSE(
> +       [AC_LANG_PROGRAM(
> +       address@hidden:@include <unistd.h>]],
> +       address@hidden:@if _POSIX_VERSION < 200112 && !defined __GLIBC__
> +          @%:@error "'free (NULL)' is not known to work"
> +         @%:@endif]])],

This is too conservative. This test succeeds only on glibc systems,
and fails on Solaris, IRIX, HP-UX, OSF/1, AIX, Woe32. Honestly, I don't want
the binaries on all these platforms (Solaris, IRIX, HP-UX, OSF/1, AIX,
Woe32) to be punished for a bug in old old SunOS 4. Can you instead make
up a test specific to SunOS 4 ? (We already agreed that we don't care
about BSD 4.2 systems and things like that.) Three ways to test for
SunOS 4 are:
  - use AC_CANONICAL_HOST
  - test for   (defined(sun) && defined(__sun)) && defined (HAVE_VADVISE)
  - test for   !HAVE_ATEXIT

Bruno





reply via email to

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