@@ -11,6 +11,7 @@ AC_CACHE_CHECK(
11
11
[ qt_cv_aligned_attr] ,
12
12
[ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ [
13
13
int foo __attribute__((aligned(64)));
14
+ int f(int i);
14
15
int f(int i) { foo = 1; return foo; }] ] ) ] ,
15
16
[ qt_cv_aligned_attr=yes] ,
16
17
[ qt_cv_aligned_attr=no] ) ] )
@@ -25,8 +26,10 @@ AC_CACHE_CHECK(
25
26
[ support for __attribute__((malloc))] ,
26
27
[ qt_cv_malloc_attr] ,
27
28
[ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ [
28
- __attribute__((malloc))
29
- void * f(int i) { return malloc(i); }] ] ) ] ,
29
+ #include <stdlib.h>
30
+ __attribute__((malloc)) void * f(int i);
31
+ __attribute__((malloc)) void * f(int i)
32
+ { return malloc(i); }] ] ) ] ,
30
33
[ qt_cv_malloc_attr=yes] ,
31
34
[ qt_cv_malloc_attr=no] ) ] )
32
35
AS_IF ( [ test "x$qt_cv_malloc_attr" = xyes] ,
@@ -42,7 +45,7 @@ AC_CACHE_CHECK(
42
45
[ support for __attribute__((unused))] ,
43
46
[ qt_cv_unused_attr] ,
44
47
[ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ [
45
- __attribute__((unused))
48
+ static __attribute__((unused))
46
49
int f(int i) { return i; }] ] ) ] ,
47
50
[ qt_cv_unused_attr=yes] ,
48
51
[ qt_cv_unused_attr=no] ) ] )
@@ -60,8 +63,10 @@ AC_CACHE_CHECK(
60
63
[ support for __attribute__((noinline))] ,
61
64
[ qt_cv_noinline_attr] ,
62
65
[ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ [
63
- __attribute__((noinline))
64
- void * f(int i) { return malloc(i); }] ] ) ] ,
66
+ #include <stdlib.h>
67
+ __attribute__((noinline)) void * f(int i);
68
+ __attribute__((noinline)) void * f(int i)
69
+ { return malloc(i); }] ] ) ] ,
65
70
[ qt_cv_noinline_attr=yes] ,
66
71
[ qt_cv_noinline_attr=no] ) ] )
67
72
AS_IF ( [ test "x$qt_cv_noinline_attr" = xyes] ,
@@ -77,6 +82,8 @@ AC_CACHE_CHECK(
77
82
[ support for __attribute__((deprecated))] ,
78
83
[ qt_cv_deprecated_attr] ,
79
84
[ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ [
85
+ #include <stdlib.h>
86
+ void * __attribute__((deprecated)) f (int i);
80
87
void * __attribute__((deprecated)) f (int i)
81
88
{ return malloc(i); }] ] ) ] ,
82
89
[ qt_cv_deprecated_attr=yes] ,
0 commit comments