+2007-02-09 Alexei Sheplyakov <varg@theor.jinr.ru>
+ Richard B. Kreckel <kreckel@ginac.de>
+
+ Avoid compiler warning about ignored 'flatten' attribute directive:
+ * m4/cc.m4 (CL_ATTRIBUTE_FLATTEN): New macro...
+ * configure.ac: ...used here...
+ * include/cln/config.h.in: ...defining CL_HAVE_ATTRIBUTE_FLATTEN,...
+ * src/base/cl_maybe_inline.h: ...used to prevent a warning here.
+
2007-02-07 Richard B. Kreckel <kreckel@ginac.de>
* include/cln/integer.h: Enable modifying operators by default.
dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
CL_PERROR
dnl DEFS HAVE_PERROR_DECL
+CL_ATTRIBUTE_FLATTEN
+ dnl DEFS CL_HAVE_ATTRIBUTE_FLATTEN
dnl
dnl checks for compiler characteristics
dnl
#ifndef CL_GLOBAL_CONSTRUCTOR_SUFFIX_NOPIC
#undef CL_GLOBAL_CONSTRUCTOR_SUFFIX_NOPIC
#endif
+/* Define if the compiler knows about __attribute__((flatten)). */
+#ifndef CL_HAVE_ATTRIBUTE_FLATTEN
+#undef CL_HAVE_ATTRIBUTE_FLATTEN
+#endif
/* CL_CHAR_UNSIGNED */
#ifndef __CHAR_UNSIGNED__
fi
AC_SUBST(ASMFLAGS)
])
+
+
+dnl Checks whether the compiler supports __attribute__((flatten)).
+AC_DEFUN([CL_ATTRIBUTE_FLATTEN],[
+AC_REQUIRE([AC_PROG_CXX])
+AC_CACHE_CHECK([whether the compiler supports __attribute__((flatten))], cl_cv_have_attr_flatten, [dnl
+ cat > conftest.cc <<EOF
+void f() __attribute__((flatten));
+EOF
+AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -c conftest.cc >/dev/null 2>conftest.out)
+if grep -i "warning" conftest.out > /dev/null; then
+ cl_cv_have_attr_flatten=no
+else
+ cl_cv_have_attr_flatten=yes
+fi
+rm -f conftest*
+])
+if test $cl_cv_have_attr_flatten = yes; then
+ AC_DEFINE(CL_HAVE_ATTRIBUTE_FLATTEN)
+fi
+])
#ifndef _CL_MAYBE_INLINE_H
#define _CL_MAYBE_INLINE_H
+#include "cln/config.h"
+
/*
* Selectively inline a function in *some* translation units.
*
* a function.
* 2. It's ignored if the optimization is switched off.
*/
-#ifdef __GNUC__
+#if defined(__GNUC__) && defined(CL_ATTRIBUTE_FLATTEN)
#define CL_FLATTEN __attribute__((flatten))
#else
#define CL_FLATTEN