From: Todd C. Miller Date: Mon, 30 Jul 2007 13:29:06 +0000 (+0000) Subject: Fix link tests such that new gcc doesn't optimize away the test. X-Git-Tag: SUDO_1_7_0~455 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e81f9efd144f78af84ff5747627eeb5fa4b819c8;p=sudo Fix link tests such that new gcc doesn't optimize away the test. --- diff --git a/aclocal.m4 b/aclocal.m4 index 1e27c39fe..7e1611f55 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -229,7 +229,7 @@ dnl check for isblank(3) dnl AC_DEFUN([SUDO_FUNC_ISBLANK], [AC_CACHE_CHECK([for isblank], sudo_cv_func_isblank, - [AC_TRY_LINK([#include ], [(void)isblank(1);], + [AC_TRY_LINK([#include ], [return (isblank('a'));], sudo_cv_func_isblank=yes, sudo_cv_func_isblank=no)]) ] [ if test "$sudo_cv_func_isblank" = "yes"; then diff --git a/configure b/configure index 348384aa1..9a23af89f 100755 --- a/configure +++ b/configure @@ -15793,7 +15793,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -(void)isblank(1); +return (isblank('a')); ; return 0; } @@ -16785,7 +16785,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -DIR d; (void)&d.dd_fd; +DIR d; memset(&d, 0, sizeof(d)); return(d.dd_fd); ; return 0; } diff --git a/configure.in b/configure.in index b569f21ab..2a86000f8 100644 --- a/configure.in +++ b/configure.in @@ -1728,7 +1728,7 @@ dnl Check for the dirfd function/macro. If not found, look for dd_fd in DIR. dnl AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include <$ac_header_dirent>]], [[DIR d; (void)dirfd(&d);]])], [AC_DEFINE(HAVE_DIRFD)], [AC_TRY_LINK([#include -#include <$ac_header_dirent>], [DIR d; (void)&d.dd_fd;], [AC_DEFINE(HAVE_DD_FD)])]) +#include <$ac_header_dirent>], [DIR d; memset(&d, 0, sizeof(d)); return(d.dd_fd);], [AC_DEFINE(HAVE_DD_FD)])]) dnl dnl If NEED_SNPRINTF is set, add snprintf.c to LIBOBJS dnl (it contains snprintf, vsnprintf, asprintf, and vasprintf)