Skip to content

Commit

Permalink
Reduce unused variable warnings in config.log (#14264)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
petk committed May 18, 2024
1 parent 20fafa7 commit 5276734
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
7 changes: 5 additions & 2 deletions Zend/Zend.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
_FPU_SETCW(fpu_cw);
result = a / b;
_FPU_SETCW(fpu_oldcw);
(void)result;
]])],[ac_cfp_have__fpu_setcw=yes],[ac_cfp_have__fpu_setcw=no])
if test "$ac_cfp_have__fpu_setcw" = "yes" ; then
AC_DEFINE(HAVE__FPU_SETCW, 1, [whether _FPU_SETCW is present and usable])
Expand All @@ -42,6 +43,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
fpsetprec(FP_PD);
result = a / b;
fpsetprec(fpu_oldprec);
(void)result;
]])], [ac_cfp_have_fpsetprec=yes], [ac_cfp_have_fpsetprec=no])
if test "$ac_cfp_have_fpsetprec" = "yes" ; then
AC_DEFINE(HAVE_FPSETPREC, 1, [whether fpsetprec is present and usable])
Expand All @@ -63,6 +65,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
_controlfp(_PC_53, _MCW_PC);
result = a / b;
_controlfp(fpu_oldcw, _MCW_PC);
(void)result;
]])], [ac_cfp_have__controlfp=yes], [ac_cfp_have__controlfp=no])
if test "$ac_cfp_have__controlfp" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP, 1, [whether _controlfp is present usable])
Expand All @@ -85,6 +88,7 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
_controlfp_s(&fpu_cw, _PC_53, _MCW_PC);
result = a / b;
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
(void)result;
]])], [ac_cfp_have__controlfp_s=yes], [ac_cfp_have__controlfp_s=no])
if test "$ac_cfp_have__controlfp_s" = "yes" ; then
AC_DEFINE(HAVE__CONTROLFP_S, 1, [whether _controlfp_s is present and usable])
Expand All @@ -105,10 +109,9 @@ AC_DEFUN([ZEND_CHECK_FLOAT_PRECISION],[
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&oldcw));
cw = (oldcw & ~0x0 & ~0x300) | 0x200;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
result = a / b;
__asm__ __volatile__ ("fldcw %0" : : "m" (*&oldcw));
(void)result;
]])], [ac_cfp_have_fpu_inline_asm_x86=yes], [ac_cfp_have_fpu_inline_asm_x86=no])
if test "$ac_cfp_have_fpu_inline_asm_x86" = "yes" ; then
AC_DEFINE(HAVE_FPU_INLINE_ASM_X86, 1, [whether FPU control word can be manipulated by inline assembler])
Expand Down
10 changes: 9 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ AC_CACHE_CHECK(whether the compiler supports __alignof__, ac_cv_alignof_exists,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
]],[[
int align = __alignof__(int);
(void)align;
]])],[
ac_cv_alignof_exists=yes
],[
Expand Down Expand Up @@ -571,7 +572,14 @@ dnl Check for IPv6 support.
AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>]], [[struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;]])],
#include <netinet/in.h>]], [[
struct sockaddr_in6 s;
struct in6_addr t = in6addr_any;
int i = AF_INET6;
(void)s;
t.s6_addr[0] = 0;
(void)i;
]])],
[ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])

dnl Checks for library functions.
Expand Down
21 changes: 18 additions & 3 deletions sapi/fpm/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,12 @@ AC_DEFUN([AC_FPM_LQ],
AC_MSG_CHECKING([for TCP_INFO])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[struct tcp_info ti; int x = TCP_INFO;]])], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[
struct tcp_info ti;
int x = TCP_INFO;
(void)ti;
(void)x;
]])], [
have_lq=tcp_info
AC_MSG_RESULT([yes])
], [
Expand All @@ -278,7 +283,12 @@ AC_DEFUN([AC_FPM_LQ],
AC_MSG_CHECKING([for TCP_CONNECTION_INFO])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[struct tcp_connection_info ti; int x = TCP_CONNECTION_INFO;]])], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[
struct tcp_connection_info ti;
int x = TCP_CONNECTION_INFO;
(void)ti;
(void)x;
]])], [
have_lq=tcp_connection_info
AC_MSG_RESULT([yes])
], [
Expand All @@ -292,7 +302,12 @@ AC_DEFUN([AC_FPM_LQ],
if test "$have_lq" = "no" ; then
AC_MSG_CHECKING([for SO_LISTENQLEN])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[int x = SO_LISTENQLIMIT; int y = SO_LISTENQLEN;]])], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[
int x = SO_LISTENQLIMIT;
int y = SO_LISTENQLEN;
(void)x;
(void)y;
]])], [
have_lq=so_listenq
AC_MSG_RESULT([yes])
], [
Expand Down

0 comments on commit 5276734

Please sign in to comment.