From 4af5dd813c040d30bcb0666a09300997a5d7f46d Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Tue, 16 Jun 2009 01:28:08 +0000 Subject: Ensure that configure-script testing for compiler attributes actually works. The configure script tests for compiler attributes didn't actually enable enough warnings or provide a proper test harness to determine whether the compiler supports the attribute in question or not; this caused gcc 4.1 to report that it supports 'weakref', but it doesn't actually support it in the way that is needed for our optional API mechanism. The new configure script test will properly distinguish between full support and partial support for this attribute, among others. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200764 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- autoconf/ast_gcc_attribute.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'autoconf') diff --git a/autoconf/ast_gcc_attribute.m4 b/autoconf/ast_gcc_attribute.m4 index c4488454d..806b39019 100644 --- a/autoconf/ast_gcc_attribute.m4 +++ b/autoconf/ast_gcc_attribute.m4 @@ -5,12 +5,12 @@ AC_DEFUN([AST_GCC_ATTRIBUTE], [ AC_MSG_CHECKING(for compiler 'attribute $1' support) saved_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Werror" +CFLAGS="$CFLAGS -Wall -Wno-unused -Werror" if test "x$2" = "x" then AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([void __attribute__(($1)) *test(void *muffin, ...) {}], + AC_LANG_PROGRAM([static void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}], []), AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]), @@ -18,7 +18,7 @@ AC_COMPILE_IFELSE( ) else AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([void __attribute__(($2)) *test(void *muffin, ...) {}], + AC_LANG_PROGRAM([static void __attribute__(($2)) *test(void *muffin, ...) {return (void *) 0;}], []), AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]), -- cgit v1.2.3