Re: how to test HAVE_MALLOC

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

 



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
bfriesen@xxxxxxxxxxxxxxxxxxx, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux