autoconf
[Top][All Lists]
Advanced

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

Re: how to test HAVE_MALLOC


From: Bob Friesenhahn
Subject: Re: how to test HAVE_MALLOC
Date: Fri, 5 Feb 2010 12:49:35 -0600 (CST)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Fri, 5 Feb 2010, j.wuttke wrote:

Your use of the term "::malloc" makes it sound like this test is
somehow related to C++ rather than C.

It's a C++ program, and the error occurs in

Is the problematic AC_FUNC_MALLOC macro being executed using the C or the C++ compiler? It is surely designed to be used with a C compiler.

#include <boost/format.hpp>

So, deeply in boost (which I considered serious work up to now)
some call to malloc() is made.

It is certainly a seriously large work. :-)

It is important to distinguish between availability of a C function in the standard C library, and how system header files prepared for C++ may allow that function to be namespace scoped in C++. They are two different issues. AC_FUNC_MALLOC is intended to test for the availability of the malloc() function in the standard C library ("libc") using the C compiler.

If the proper prototype for malloc is not present when the test is performed, then a C++ compiler may assume C++ binding for that function rather than C binding, and be looking for a different (scrambled) function name than 'malloc'.

Bob
--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/




reply via email to

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