From c075a7239937e6ae45bcd3793c37b0168bfae93d Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Thu, 9 Aug 2012 20:21:25 +0000 Subject: [PATCH] configure: fix double check tests with Clang Configuring with Clang compiler with -Werror would not work after improved checks: /tmp/qemu-conf--25992-.c:4:32: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare] int main(void) { return preadv == preadv; } /tmp/qemu-conf--25992-.c:13:26: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare] return epoll_create1 == epoll_create1; /tmp/qemu-conf--25992-.c:3:13: error: explicitly assigning a variable of type 'char **' to itself [-Werror,-Wself-assign] environ = environ; Avoid the errors by adjusting the tests. Reviewed-by: Peter Maydell Signed-off-by: Blue Swirl --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 12fdc22669..f0dbc03af2 100755 --- a/configure +++ b/configure @@ -2256,7 +2256,7 @@ cat > $TMPC < #include #include -int main(void) { return preadv == preadv; } +int main(void) { return preadv(0, 0, 0, 0); } EOF preadv=no if compile_prog "" "" ; then @@ -2552,7 +2552,7 @@ int main(void) * warning but not an error, and will proceed to fail the * qemu compile where we compile with -Werror.) */ - return epoll_create1 == epoll_create1; + return (int)(uintptr_t)&epoll_create1; } EOF if compile_prog "" "" ; then @@ -2945,7 +2945,7 @@ has_environ=no cat > $TMPC << EOF #include int main(void) { - environ = environ; + environ = 0; return 0; } EOF -- 2.39.2