Skip to content

Commit 9ad5381

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix -Wimplicit-function-declaration in configure
2 parents c00816a + aa405b7 commit 9ad5381

File tree

4 files changed

+49
-34
lines changed

4 files changed

+49
-34
lines changed

Zend/Zend.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,16 @@ int main()
164164
double d = (double) LONG_MIN * LONG_MIN + 2e9;
165165
166166
if ((long) d == 2e9 && (long) -d == -2e9) {
167-
exit(0);
167+
return 0;
168168
}
169169
} else if (sizeof(long) == 8) {
170170
double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */
171171
172172
if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */
173-
exit(0);
173+
return 0;
174174
}
175175
}
176-
exit(1);
176+
return 1;
177177
}
178178
]])], [
179179
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
@@ -284,7 +284,7 @@ int main()
284284
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
285285
fclose(fp);
286286
287-
exit(0);
287+
return 0;
288288
}
289289
]])], [
290290
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`

build/php.m4

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,14 +1176,14 @@ AC_DEFUN([PHP_DOES_PWRITE_WORK],[
11761176
#include <unistd.h>
11771177
#include <errno.h>
11781178
$1
1179-
main() {
1179+
int main() {
11801180
int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
11811181
1182-
if (fd < 0) exit(1);
1183-
if (pwrite(fd, "text", 4, 0) != 4) exit(1);
1182+
if (fd < 0) return 1;
1183+
if (pwrite(fd, "text", 4, 0) != 4) return 1;
11841184
/* Linux glibc breakage until 2.2.5 */
1185-
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) exit(1);
1186-
exit(0);
1185+
if (pwrite(fd, "text", 4, -1) != -1 || errno != EINVAL) return 1;
1186+
return 0;
11871187
}
11881188
11891189
]])],[
@@ -1209,14 +1209,14 @@ AC_DEFUN([PHP_DOES_PREAD_WORK],[
12091209
#include <unistd.h>
12101210
#include <errno.h>
12111211
$1
1212-
main() {
1212+
int main() {
12131213
char buf[3];
12141214
int fd = open("conftest_in", O_RDONLY);
1215-
if (fd < 0) exit(1);
1216-
if (pread(fd, buf, 2, 0) != 2) exit(1);
1215+
if (fd < 0) return 1;
1216+
if (pread(fd, buf, 2, 0) != 2) return 1;
12171217
/* Linux glibc breakage until 2.2.5 */
1218-
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
1219-
exit(0);
1218+
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) return 1;
1219+
return 0;
12201220
}
12211221
]])],[
12221222
ac_cv_pread=yes
@@ -1478,13 +1478,13 @@ int seeker(void *cookie, off64_t *position, int whence)
14781478
14791479
cookie_io_functions_t funcs = {reader, writer, seeker, closer};
14801480
1481-
main() {
1481+
int main() {
14821482
struct cookiedata g = { 0 };
14831483
FILE *fp = fopencookie(&g, "r", funcs);
14841484
14851485
if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)
1486-
exit(0);
1487-
exit(1);
1486+
return 0;
1487+
return 1;
14881488
}
14891489
14901490
]])], [

configure.ac

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ dnl getaddrinfo.
662662
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
663663
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
664664
[[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
665+
#include <string.h>
665666
#include <netdb.h>
666667
#include <sys/types.h>
667668
#ifndef AF_INET
@@ -674,28 +675,28 @@ int main(void) {
674675
hints.ai_flags = AI_NUMERICHOST;
675676
676677
if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
677-
exit(1);
678+
return 1;
678679
}
679680
680681
if (ai == 0) {
681-
exit(1);
682+
return 1;
682683
}
683684
684685
pai = ai;
685686
686687
while (pai) {
687688
if (pai->ai_family != AF_INET) {
688689
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
689-
exit(1);
690+
return 1;
690691
}
691692
if (pai->ai_addr->sa_family != AF_INET) {
692693
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
693-
exit(1);
694+
return 1;
694695
}
695696
pai = pai->ai_next;
696697
}
697698
freeaddrinfo(ai);
698-
exit(0);
699+
return 0;
699700
}
700701
]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])],
701702
[ac_cv_func_getaddrinfo=no])])

ext/standard/config.m4

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ AC_CACHE_CHECK([whether flush should be called explicitly after a buffered io],
55
AC_RUN_IFELSE([AC_LANG_SOURCE([[
66
#include <stdio.h>
77
#include <stdlib.h>
8+
#include <string.h>
9+
#include <unistd.h>
810
911
int main(int argc, char **argv)
1012
{
@@ -59,6 +61,8 @@ fi
5961

6062
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
6163
AC_RUN_IFELSE([AC_LANG_SOURCE([[
64+
#include <string.h>
65+
6266
#if HAVE_UNISTD_H
6367
#include <unistd.h>
6468
#endif
@@ -70,9 +74,9 @@ AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
7074
int main() {
7175
#if HAVE_CRYPT
7276
char *encrypted = crypt("rasmuslerdorf","rl");
73-
exit(!encrypted || strcmp(encrypted,"rl.3StKT.4T8M"));
77+
return !encrypted || strcmp(encrypted,"rl.3StKT.4T8M");
7478
#else
75-
exit(1);
79+
return 1;
7680
#endif
7781
}]])],[
7882
ac_cv_crypt_des=yes
@@ -84,6 +88,8 @@ int main() {
8488

8589
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
8690
AC_RUN_IFELSE([AC_LANG_SOURCE([[
91+
#include <string.h>
92+
8793
#if HAVE_UNISTD_H
8894
#include <unistd.h>
8995
#endif
@@ -95,9 +101,9 @@ AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
95101
int main() {
96102
#if HAVE_CRYPT
97103
char *encrypted = crypt("rasmuslerdorf","_J9..rasm");
98-
exit(!encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc"));
104+
return !encrypted || strcmp(encrypted,"_J9..rasmBYk8r9AiWNc");
99105
#else
100-
exit(1);
106+
return 1;
101107
#endif
102108
}]])],[
103109
ac_cv_crypt_ext_des=yes
@@ -109,6 +115,8 @@ int main() {
109115

110116
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
111117
AC_RUN_IFELSE([AC_LANG_SOURCE([[
118+
#include <string.h>
119+
112120
#if HAVE_UNISTD_H
113121
#include <unistd.h>
114122
#endif
@@ -130,9 +138,9 @@ int main() {
130138
strcpy(answer,salt);
131139
strcat(answer,"rISCgZzpwk3UhDidwXvin0");
132140
encrypted = crypt("rasmuslerdorf",salt);
133-
exit(!encrypted || strcmp(encrypted,answer));
141+
return !encrypted || strcmp(encrypted,answer);
134142
#else
135-
exit(1);
143+
return 1;
136144
#endif
137145
}]])],[
138146
ac_cv_crypt_md5=yes
@@ -144,6 +152,8 @@ int main() {
144152

145153
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
146154
AC_RUN_IFELSE([AC_LANG_SOURCE([[
155+
#include <string.h>
156+
147157
#if HAVE_UNISTD_H
148158
#include <unistd.h>
149159
#endif
@@ -162,9 +172,9 @@ int main() {
162172
strcpy(answer,salt);
163173
strcpy(&answer[29],"nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra");
164174
encrypted = crypt("rasmuslerdorf",salt);
165-
exit(!encrypted || strcmp(encrypted,answer));
175+
return !encrypted || strcmp(encrypted,answer);
166176
#else
167-
exit(1);
177+
return 1;
168178
#endif
169179
}]])],[
170180
ac_cv_crypt_blowfish=yes
@@ -176,6 +186,8 @@ int main() {
176186

177187
AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_sha512,[
178188
AC_RUN_IFELSE([AC_LANG_SOURCE([[
189+
#include <string.h>
190+
179191
#if HAVE_UNISTD_H
180192
#include <unistd.h>
181193
#endif
@@ -193,9 +205,9 @@ int main() {
193205
strcpy(answer, salt);
194206
strcat(answer, "EeHCRjm0bljalWuALHSTs1NB9ipEiLEXLhYeXdOpx22gmlmVejnVXFhd84cEKbYxCo.XuUTrW.RLraeEnsvWs/");
195207
encrypted = crypt("rasmuslerdorf",salt);
196-
exit(!encrypted || strcmp(encrypted,answer));
208+
return !encrypted || strcmp(encrypted,answer);
197209
#else
198-
exit(1);
210+
return 1;
199211
#endif
200212
}]])],[
201213
ac_cv_crypt_sha512=yes
@@ -207,6 +219,8 @@ int main() {
207219

208220
AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_sha256,[
209221
AC_RUN_IFELSE([AC_LANG_SOURCE([[
222+
#include <string.h>
223+
210224
#if HAVE_UNISTD_H
211225
#include <unistd.h>
212226
#endif
@@ -224,9 +238,9 @@ int main() {
224238
strcpy(answer, salt);
225239
strcat(answer, "cFAm2puLCujQ9t.0CxiFIIvFi4JyQx5UncCt/xRIX23");
226240
encrypted = crypt("rasmuslerdorf",salt);
227-
exit(!encrypted || strcmp(encrypted,answer));
241+
return !encrypted || strcmp(encrypted,answer);
228242
#else
229-
exit(1);
243+
return 1;
230244
#endif
231245
}]])],[
232246
ac_cv_crypt_sha256=yes

0 commit comments

Comments
 (0)