From ab0576a2034b03f92943ac477e4e97731a899554 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 7 Jun 2015 22:25:22 +0200 Subject: [PATCH] Fix autoconf check for function attributes. GCC warns when a function attribute has no effect. The autoconf check turns warnings about attributes into errors, therefore thinking that they did not work. The reason was that the test function returned void, which is not suitable for checking both __malloc__ and __warn_unused_result__. --- m4/attribute.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/attribute.m4 b/m4/attribute.m4 index 6a8f555..9d673e9 100644 --- a/m4/attribute.m4 +++ b/m4/attribute.m4 @@ -9,8 +9,8 @@ AC_DEFUN([tinc_ATTRIBUTE], CFLAGS="$CFLAGS -Wall -Werror" AC_COMPILE_IFELSE( [AC_LANG_SOURCE( - [void test(void) __attribute__ (($1)); - void test(void) { return; } + [void *test(void) __attribute__ (($1)); + void *test(void) { return (void *)0; } ], )], [tinc_cv_attribute_$1=yes], -- 2.25.1