From 62b4dcf17e2b7d73f728b13109520a76ac8935a6 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Wed, 20 Jun 2001 00:08:45 +0200 Subject: More of: * acinclude.m4, configure.in (GMP_C_ATTRIBUTE_MALLOC): New macro. --- acinclude.m4 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'acinclude.m4') diff --git a/acinclude.m4 b/acinclude.m4 index f83bfb731..809f0f7e1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1352,12 +1352,28 @@ fi dnl GMP_C_ATTRIBUTE_MALLOC dnl ---------------------- +dnl gcc 2.95.x accepts __attribute__ ((malloc)) but with a warning that +dnl it's ignored. Pretend it doesn't exist in this case, to avoid that +dnl warning. AC_DEFUN(GMP_C_ATTRIBUTE_MALLOC, [AC_CACHE_CHECK([whether gcc __attribute__ ((malloc)) works], gmp_cv_c_attribute_malloc, -[AC_TRY_COMPILE([void *foo (int x) __attribute__ ((malloc));], , - gmp_cv_c_attribute_malloc=yes, gmp_cv_c_attribute_malloc=no) +[cat >conftest.c </dev/null; then + gmp_cv_c_attribute_malloc=no + else + gmp_cv_c_attribute_malloc=yes + fi +else + gmp_cv_c_attribute_malloc=no +fi +cat conftest.out >&AC_FD_CC +rm -f conftest* ]) if test $gmp_cv_c_attribute_malloc = yes; then AC_DEFINE(HAVE_ATTRIBUTE_MALLOC, 1, -- cgit v1.2.1