Skip to content

Commit d3cf597

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix -Wimplicit-function-declaration in configure
2 parents 1079622 + 9ad5381 commit d3cf597

File tree

4 files changed

+44
-31
lines changed

4 files changed

+44
-31
lines changed

Zend/Zend.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,16 @@ int main()
163163
double d = (double) LONG_MIN * LONG_MIN + 2e9;
164164
165165
if ((long) d == 2e9 && (long) -d == -2e9) {
166-
exit(0);
166+
return 0;
167167
}
168168
} else if (sizeof(long) == 8) {
169169
double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */
170170
171171
if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */
172-
exit(0);
172+
return 0;
173173
}
174174
}
175-
exit(1);
175+
return 1;
176176
}
177177
]])], [
178178
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
@@ -268,7 +268,7 @@ int main()
268268
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
269269
fclose(fp);
270270
271-
exit(0);
271+
return 0;
272272
}
273273
]])], [
274274
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`

build/php.m4

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,11 +1158,11 @@ $1
11581158
int main() {
11591159
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
11601160
1161-
if (fd < 0) exit(1);
1162-
if (pwrite(fd, "text", 4, 0) != 4) exit(1);
1161+
if (fd < 0) return 1;
1162+
if (pwrite(fd, "text", 4, 0) != 4) return 1;
11631163
/* Linux glibc breakage until 2.2.5 */
1164-
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
1165-
exit(0);
1164+
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
1165+
return 0;
11661166
}
11671167
11681168
]])],[
@@ -1192,11 +1192,11 @@ $1
11921192
int main() {
11931193
char buf[3];
11941194
int fd = open("conftest_in", O_RDONLY);
1195-
if (fd < 0) exit(1);
1196-
if (pread(fd, buf, 2, 0) != 2) exit(1);
1195+
if (fd < 0) return 1;
1196+
if (pread(fd, buf, 2, 0) != 2) return 1;
11971197
/* Linux glibc breakage until 2.2.5 */
1198-
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
1199-
exit(0);
1198+
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
1199+
return 0;
12001200
}
12011201
]])],[
12021202
ac_cv_pread=yes
@@ -1464,8 +1464,8 @@ int main() {
14641464
FILE *fp = fopencookie(&g, "r", funcs);
14651465
14661466
if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
1467-
exit(0);
1468-
exit(1);
1467+
return 0;
1468+
return 1;
14691469
}
14701470
14711471
]])], [

configure.ac

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ dnl getaddrinfo.
612612
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
613613
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
614614
[[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
615+
#include <string.h>
615616
#include <netdb.h>
616617
#include <sys/types.h>
617618
#include <string.h>
@@ -626,28 +627,28 @@ int main(void) {
626627
hints.ai_flags = AI_NUMERICHOST;
627628
628629
if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
629-
exit(1);
630+
return 1;
630631
}
631632
632633
if (ai == 0) {
633-
exit(1);
634+
return 1;
634635
}
635636
636637
pai = ai;
637638
638639
while (pai) {
639640
if (pai->ai_family != AF_INET) {
640641
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
641-
exit(1);
642+
return 1;
642643
}
643644
if (pai->ai_addr->sa_family != AF_INET) {
644645
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
645-
exit(1);
646+
return 1;
646647
}
647648
pai = pai->ai_next;
648649
}
649650
freeaddrinfo(ai);
650-
exit(0);
651+
return 0;
651652
}
652653
]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])],
653654
[ac_cv_func_getaddrinfo=no])])

ext/standard/config.m4

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ fi
5959

6060
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
6161
AC_RUN_IFELSE([AC_LANG_SOURCE([[
62+
#include <string.h>
63+
6264
#if HAVE_UNISTD_H
6365
#include <unistd.h>
6466
#endif
@@ -73,9 +75,9 @@ AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
7375
int main() {
7476
#if HAVE_CRYPT
7577
char *encrypted = crypt("rasmuslerdorf","rl");
76-
exit(!encrypted || strcmp(encrypted,"rl.3StKT.4T8M"));
78+
return !encrypted || strcmp(encrypted,"rl.3StKT.4T8M");
7779
#else
78-
exit(1);
80+
return 1;
7981
#endif
8082
}]])],[
8183
ac_cv_crypt_des=yes
@@ -87,6 +89,8 @@ int main() {
8789

8890
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
8991
AC_RUN_IFELSE([AC_LANG_SOURCE([[
92+
#include <string.h>
93+
9094
#if HAVE_UNISTD_H
9195
#include <unistd.h>
9296
#endif
@@ -101,9 +105,9 @@ AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
101105
int main() {
102106
#if HAVE_CRYPT
103107
char *encrypted = crypt("rasmuslerdorf","_J9..rasm");
104-
exit(!encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc"));
108+
return !encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc");
105109
#else
106-
exit(1);
110+
return 1;
107111
#endif
108112
}]])],[
109113
ac_cv_crypt_ext_des=yes
@@ -115,6 +119,8 @@ int main() {
115119

116120
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
117121
AC_RUN_IFELSE([AC_LANG_SOURCE([[
122+
#include <string.h>
123+
118124
#if HAVE_UNISTD_H
119125
#include <unistd.h>
120126
#endif
@@ -139,9 +145,9 @@ int main() {
139145
strcpy(answer,salt);
140146
strcat(answer,"rISCgZzpwk3UhDidwXvin0");
141147
encrypted = crypt("rasmuslerdorf",salt);
142-
exit(!encrypted || strcmp(encrypted,answer));
148+
return !encrypted || strcmp(encrypted,answer);
143149
#else
144-
exit(1);
150+
return 1;
145151
#endif
146152
}]])],[
147153
ac_cv_crypt_md5=yes
@@ -153,6 +159,8 @@ int main() {
153159

154160
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
155161
AC_RUN_IFELSE([AC_LANG_SOURCE([[
162+
#include <string.h>
163+
156164
#if HAVE_UNISTD_H
157165
#include <unistd.h>
158166
#endif
@@ -174,9 +182,9 @@ int main() {
174182
strcpy(answer,salt);
175183
strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra");
176184
encrypted = crypt("rasmuslerdorf",salt);
177-
exit(!encrypted || strcmp(encrypted,answer));
185+
return !encrypted || strcmp(encrypted,answer);
178186
#else
179-
exit(1);
187+
return 1;
180188
#endif
181189
}]])],[
182190
ac_cv_crypt_blowfish=yes
@@ -188,6 +196,8 @@ int main() {
188196

189197
AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_sha512,[
190198
AC_RUN_IFELSE([AC_LANG_SOURCE([[
199+
#include <string.h>
200+
191201
#if HAVE_UNISTD_H
192202
#include <unistd.h>
193203
#endif
@@ -208,9 +218,9 @@ int main() {
208218
strcpy(answer, salt);
209219
strcat(answer, "EeHCRjm0bljalWuALHSTs1NB9ipEiLEXLhYeXdOpx22gmlmVejnVXFhd84cEKbYxCo.XuUTrW.RLraeEnsvWs/");
210220
encrypted = crypt("rasmuslerdorf",salt);
211-
exit(!encrypted || strcmp(encrypted,answer));
221+
return !encrypted || strcmp(encrypted,answer);
212222
#else
213-
exit(1);
223+
return 1;
214224
#endif
215225
}]])],[
216226
ac_cv_crypt_sha512=yes
@@ -222,6 +232,8 @@ int main() {
222232

223233
AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_sha256,[
224234
AC_RUN_IFELSE([AC_LANG_SOURCE([[
235+
#include <string.h>
236+
225237
#if HAVE_UNISTD_H
226238
#include <unistd.h>
227239
#endif
@@ -242,9 +254,9 @@ int main() {
242254
strcpy(answer, salt);
243255
strcat(answer, "cFAm2puLCujQ9t.0CxiFIIvFi4JyQx5UncCt/xRIX23");
244256
encrypted = crypt("rasmuslerdorf",salt);
245-
exit(!encrypted || strcmp(encrypted,answer));
257+
return !encrypted || strcmp(encrypted,answer);
246258
#else
247-
exit(1);
259+
return 1;
248260
#endif
249261
}]])],[
250262
ac_cv_crypt_sha256=yes

0 commit comments

Comments
 (0)