[Top][All Lists]

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

Re: Troubles with conditional adding files to library

From: Russ Allbery
Subject: Re: Troubles with conditional adding files to library
Date: Fri, 27 Mar 2009 08:23:16 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

"Gerald I. Evenden" <address@hidden> writes:

> I use both functions quite frequently but do nothing special about
> library use or using alternate source.  I just assumed they are part of
> the standard library.  I do not understand why there is anything special
> about these routines and did wonder why the special attention was given
> them in the configure.scan.

AC_FUNC_MALLOC exists because of:

     If the `malloc' function is compatible with the GNU C library
     `malloc' (i.e., `malloc (0)' returns a valid pointer), define
     `HAVE_MALLOC' to 1.  Otherwise define `HAVE_MALLOC' to 0, ask for
     an `AC_LIBOBJ' replacement for `malloc', and define `malloc' to
     `rpl_malloc' so that the native `malloc' is not used in the main

If you don't rely on malloc(0) working, you don't care.  I never rely on
that; I think it's bad coding style.

AC_FUNC_STRTOD exists because of:

    /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
    char *string = " +69";
    char *term;
    double value;
    value = strtod (string, &term);
    if (value != 69 || term != (string + 4))
      return 1;


    /* Under Solaris 2.4, strtod returns the wrong value for the
       terminating character under some conditions.  */
    char *string = "NaN";
    char *term;
    strtod (string, &term);
    if (term != string && *(term - 1) == 0)
      return 1;

If your uses of strtod don't care, you probably don't care about this one

The Autoconf manual has the documentation for both of these.

Russ Allbery (address@hidden)             <>

reply via email to

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