]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Use argv in OSSH_CHECK_CFLAG_COMPILE test.
authorDarren Tucker <dtucker@dtucker.net>
Tue, 28 Jul 2020 09:40:30 +0000 (19:40 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Tue, 28 Jul 2020 09:40:30 +0000 (19:40 +1000)
configure.ac is not detecting -Wextra in compilers that implement the
option. The problem is that -Wextra implies -Wunused-parameter, and the
C excerpt used by aclocal.m4 does not use argv.  Patch from pedro at
ambientworks.net, ok djm@

aclocal.m4
configure.ac

index 0193c3dccf81ebc5e397d8a16904aa35bb0d98d2..b70856e433a5bc86dbb6daa8bd15c98f426a8241 100644 (file)
@@ -15,6 +15,7 @@ AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{
 #include <stdlib.h>
 #include <stdio.h>
 int main(int argc, char **argv) {
+       (void)argv;
        /* Some math to catch -ftrapv problems in the toolchain */
        int i = 123 * argc, j = 456 + argc, k = 789 - argc;
        float l = i * 2.1;
@@ -62,6 +63,7 @@ AC_DEFUN([OSSH_CHECK_CFLAG_LINK], [{
 #include <stdlib.h>
 #include <stdio.h>
 int main(int argc, char **argv) {
+       (void)argv;
        /* Some math to catch -ftrapv problems in the toolchain */
        int i = 123 * argc, j = 456 + argc, k = 789 - argc;
        float l = i * 2.1;
@@ -100,6 +102,7 @@ AC_DEFUN([OSSH_CHECK_LDFLAG_LINK], [{
 #include <stdlib.h>
 #include <stdio.h>
 int main(int argc, char **argv) {
+       (void)argv;
        /* Some math to catch -ftrapv problems in the toolchain */
        int i = 123 * argc, j = 456 + argc, k = 789 - argc;
        float l = i * 2.1;
index ff741735410797d6604c1094da50db79a0366c05..81a6e31f99853ec79486709b26d730dc3a6df7b3 100644 (file)
@@ -164,6 +164,7 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
        OSSH_CHECK_CFLAG_COMPILE([-Wformat-security])
        OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess])
        OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign])
+       OSSH_CHECK_CFLAG_COMPILE([-Wunused-parameter], [-Wno-unused-parameter])
        OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result])
        OSSH_CHECK_CFLAG_COMPILE([-Wimplicit-fallthrough])
        OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing])