summaryrefslogtreecommitdiff
path: root/sys-auth/pam_ssh_agent_auth/files/pam_ssh_agent_auth-0.10.4-0002-Add-missing-includes-implicit-function-declarations.patch
blob: e5b255f5cb37acf35c2f75d57e9357cc7e52f705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
https://github.com/jbeverly/pam_ssh_agent_auth/pull/41

From 634711a191c1b8be6ea6eb9251ab60a8cb73c6ad Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Fri, 30 Sep 2022 20:54:45 +0100
Subject: [PATCH 2/2] Add missing includes (implicit function declarations)

This fixes building with Clang 16.

Bug: https://bugs.gentoo.org/870721
Closes: https://github.com/jbeverly/pam_ssh_agent_auth/pull/36
Signed-off-by: Sam James <sam@gentoo.org>
--- a/configure.ac
+++ b/configure.ac
@@ -388,6 +388,7 @@ case "$host" in
 	    [AC_LANG_SOURCE([[
 #define testmacro foo
 #define testmacro bar
+#include <stdlib.h>
 int main(void) { exit(0); }
 	    ]])],
 	    [ AC_MSG_RESULT(yes) ],
@@ -500,6 +501,7 @@ int main(void) { exit(0); }
 	AC_DEFINE(HAVE_BUNDLE, 1, [Define if your system uses bundles instead of ELF shared objects])
 	AC_MSG_CHECKING(if we have working getaddrinfo)
 	AC_TRY_RUN([#include <mach-o/dyld.h>
+#include <stdlib.h>
 int main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
 		exit(0);
 	else
@@ -918,6 +920,7 @@ AC_MSG_CHECKING(compiler and flags for sanity)
 AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([
 #include <stdio.h>
+#include <stdlib.h>
 int main(){exit(0);}
 	])],
 	[	AC_MSG_RESULT(yes) ],
@@ -944,6 +947,7 @@ AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
 				[AC_LANG_SOURCE([[
 #include <libgen.h>
 #include <string.h>
+#include <stdlib.h>
 
 int main(int argc, char **argv) {
     char *s, buf[32];
@@ -1102,6 +1106,7 @@ AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([[
 #include <sys/types.h>
 #include <dirent.h>
+#include <stdlib.h>
 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
 	]])],
 	[AC_MSG_RESULT(yes)],
@@ -1384,6 +1389,7 @@ if test "x$ac_cv_func_snprintf" = "xyes" ; then
 	AC_RUN_IFELSE(
 		[AC_LANG_SOURCE([[
 #include <stdio.h>
+#include <stdlib.h>
 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
 		]])],
 		[AC_MSG_RESULT(yes)],
@@ -1406,8 +1412,10 @@ if test "x$ac_cv_func_asprintf" != "xyes" && \
 	AC_RUN_IFELSE(
 		[AC_LANG_SOURCE([[
 #include <sys/types.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdlib.h>
 
 int x_snprintf(char *str,size_t count,const char *fmt,...)
 {
@@ -1435,7 +1443,8 @@ fi
 # check that the fmt argument is const char * or just char *.
 # This is only useful for when BROKEN_SNPRINTF
 AC_MSG_CHECKING([whether snprintf can declare const char *fmt])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stddef.h>
+	   #include <stdio.h>
 	   int snprintf(char *a, size_t b, const char *c, ...) { return 0; }
 	   int main(void) { snprintf(0, 0, 0); } 
     ]])],
@@ -1496,6 +1505,7 @@ if test ! -z "$check_for_openpty_ctty_bug"; then
 #include <sys/fcntl.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <stdlib.h>
 
 int
 main()
@@ -1543,6 +1553,7 @@ if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
 	AC_RUN_IFELSE(
 		[AC_LANG_SOURCE([[
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/socket.h>
 #include <netdb.h>
 #include <errno.h>
@@ -1615,6 +1626,7 @@ if test "x$ac_cv_func_getaddrinfo" = "xyes" && \
 	AC_RUN_IFELSE(
 		[AC_LANG_SOURCE([[
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/socket.h>
 #include <netdb.h>
 #include <errno.h>
@@ -1677,6 +1689,7 @@ if test "x$check_for_conflicting_getspnam" = "x1"; then
 	AC_COMPILE_IFELSE([AC_LANG_SOURCE(
 		[
 #include <shadow.h>
+#include <stdlib.h>
 int main(void) {exit(0);}
 		])],
 		[
@@ -1750,6 +1763,7 @@ AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <openssl/opensslv.h>
 #define DATA "conftest.sslincver"
 int main(void) {
@@ -1785,6 +1799,7 @@ AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #include <openssl/opensslv.h>
 #include <openssl/crypto.h>
 #define DATA "conftest.ssllibver"
@@ -1828,7 +1843,9 @@ AC_MSG_CHECKING([whether OpenSSL's headers match the library])
 AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([[
 #include <string.h>
+#include <openssl/crypto.h>
 #include <openssl/opensslv.h>
+#include <stdlib.h>
 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
 	]])],
 	[
@@ -1907,6 +1924,7 @@ AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
 AC_LINK_IFELSE(
 	[AC_LANG_SOURCE([[
 #include <string.h>
+#include <stdlib.h>
 #include <openssl/evp.h>
 int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);}
 	]])],
@@ -1952,6 +1970,7 @@ AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
 AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([[
 #include <string.h>
+#include <stdlib.h>
 #include <openssl/rand.h>
 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
 	]])],
@@ -2123,6 +2142,7 @@ if test -z "$have_llong_max"; then
 	AC_RUN_IFELSE(
 		[AC_LANG_SOURCE([[
 #include <stdio.h>
+#include <stdlib.h>
 /* Why is this so damn hard? */
 #ifdef __GNUC__
 # undef __GNUC__
@@ -2597,6 +2617,7 @@ dnl test snprintf (broken on SCO w/gcc)
 		[AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 #ifdef HAVE_SNPRINTF
 int main(void)
 {
@@ -2740,6 +2761,7 @@ AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
 		ac_cv_have_accrights_in_msghdr, [
 	AC_COMPILE_IFELSE([AC_LANG_SOURCE(
 		[
+#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
@@ -2767,6 +2789,7 @@ AC_CACHE_CHECK([for msg_control field in struct msghdr],
 		ac_cv_have_control_in_msghdr, [
 	AC_COMPILE_IFELSE([AC_LANG_SOURCE(
 		[
+#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
@@ -2791,7 +2814,9 @@ if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
 fi
 
 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
-	AC_TRY_LINK([],
+	AC_TRY_LINK([
+#include <stdio.h>
+],
 		[ extern char *__progname; printf("%s", __progname); ],
 		[ ac_cv_libc_defines___progname="yes" ],
 		[ ac_cv_libc_defines___progname="no" ]
@@ -2871,7 +2896,9 @@ if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
 fi
 
 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
-	AC_TRY_LINK([],
+	AC_TRY_LINK([
+#include <stdio.h>
+],
 		[ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
 		[ ac_cv_libc_defines_sys_errlist="yes" ],
 		[ ac_cv_libc_defines_sys_errlist="no" ]
@@ -2884,7 +2911,9 @@ fi
 
 
 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
-	AC_TRY_LINK([],
+	AC_TRY_LINK([
+#include <stdio.h>
+],
 		[ extern int sys_nerr; printf("%i", sys_nerr);],
 		[ ac_cv_libc_defines_sys_nerr="yes" ],
 		[ ac_cv_libc_defines_sys_nerr="no" ]