Skip to content

Commit 5276734

Browse files
authored
Reduce unused variable warnings in config.log (#14264)
This reduces -Wunused-variable and -Wunused-but-set-variable warnings generated in the Autoconf's config.log to comply with possible stricter default compiler configuration on the system to avoid having false results.
1 parent 20fafa7 commit 5276734

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

Zend/Zend.m4

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
2121
_FPU_SETCW(fpu_cw);
2222
result = a / b;
2323
_FPU_SETCW(fpu_oldcw);
24+
(void)result;
2425
]])],[ac_cfp_have__fpu_setcw=yes],[ac_cfp_have__fpu_setcw=no])
2526
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
2627
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
@@ -42,6 +43,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
4243
fpsetprec(FP_PD);
4344
result = a / b;
4445
fpsetprec(fpu_oldprec);
46+
(void)result;
4547
]])], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
4648
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
4749
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
@@ -63,6 +65,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
6365
_controlfp(_PC_53, _MCW_PC);
6466
result = a / b;
6567
_controlfp(fpu_oldcw, _MCW_PC);
68+
(void)result;
6669
]])], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
6770
if test "$ac_cfp_have__controlfp" = "yes" ; then
6871
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
@@ -85,6 +88,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
8588
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
8689
result = a / b;
8790
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
91+
(void)result;
8892
]])], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
8993
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
9094
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
@@ -105,10 +109,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
105109
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&oldcw));
106110
cw = (oldcw & ~0x0 & ~0x300) | 0x200;
107111
__asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
108-
109112
result = a / b;
110-
111113
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
114+
(void)result;
112115
]])], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
113116
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
114117
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])

configure.ac

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ AC_CACHE_CHECK(whether the compiler supports __alignof__, ac_cv_alignof_exists,[
531531
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
532532
]],[[
533533
int align = __alignof__(int);
534+
(void)align;
534535
]])],[
535536
ac_cv_alignof_exists=yes
536537
],[
@@ -571,7 +572,14 @@ dnl Check for IPv6 support.
571572
AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
572573
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
573574
#include <sys/socket.h>
574-
#include <netinet/in.h>]], [[struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;]])],
575+
#include <netinet/in.h>]], [[
576+
struct sockaddr_in6 s;
577+
struct in6_addr t = in6addr_any;
578+
int i = AF_INET6;
579+
(void)s;
580+
t.s6_addr[0] = 0;
581+
(void)i;
582+
]])],
575583
[ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
576584

577585
dnl Checks for library functions.

sapi/fpm/config.m4

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,12 @@ AC_DEFUN([AC_FPM_LQ],
265265
266266
AC_MSG_CHECKING([for TCP_INFO])
267267
268-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[struct tcp_info ti; int x = TCP_INFO;]])], [
268+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[
269+
struct tcp_info ti;
270+
int x = TCP_INFO;
271+
(void)ti;
272+
(void)x;
273+
]])], [
269274
have_lq=tcp_info
270275
AC_MSG_RESULT([yes])
271276
], [
@@ -278,7 +283,12 @@ AC_DEFUN([AC_FPM_LQ],
278283
279284
AC_MSG_CHECKING([for TCP_CONNECTION_INFO])
280285
281-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[struct tcp_connection_info ti; int x = TCP_CONNECTION_INFO;]])], [
286+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[
287+
struct tcp_connection_info ti;
288+
int x = TCP_CONNECTION_INFO;
289+
(void)ti;
290+
(void)x;
291+
]])], [
282292
have_lq=tcp_connection_info
283293
AC_MSG_RESULT([yes])
284294
], [
@@ -292,7 +302,12 @@ AC_DEFUN([AC_FPM_LQ],
292302
if test "$have_lq" = "no" ; then
293303
AC_MSG_CHECKING([for SO_LISTENQLEN])
294304
295-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[int x = SO_LISTENQLIMIT; int y = SO_LISTENQLEN;]])], [
305+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[
306+
int x = SO_LISTENQLIMIT;
307+
int y = SO_LISTENQLEN;
308+
(void)x;
309+
(void)y;
310+
]])], [
296311
have_lq=so_listenq
297312
AC_MSG_RESULT([yes])
298313
], [

0 commit comments

Comments
 (0)