From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxibL-0004Q4-Gw for qemu-devel@nongnu.org; Sat, 04 Aug 2012 13:57:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxibK-0004BF-3z for qemu-devel@nongnu.org; Sat, 04 Aug 2012 13:57:23 -0400 Received: from mail-gg0-f173.google.com ([209.85.161.173]:41084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxibJ-0004BB-Uy for qemu-devel@nongnu.org; Sat, 04 Aug 2012 13:57:22 -0400 Received: by ggnp1 with SMTP id p1so1652329ggn.4 for ; Sat, 04 Aug 2012 10:57:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1342620628-12751-1-git-send-email-peter.maydell@linaro.org> <1342620628-12751-12-git-send-email-peter.maydell@linaro.org> From: Blue Swirl Date: Sat, 4 Aug 2012 17:57:00 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 11/11] configure: Check for -Werror causing failures when compiling tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Stefan Weil , qemu-devel@nongnu.org, patches@linaro.org On Sat, Jul 28, 2012 at 1:48 PM, Peter Maydell wrote: > On 28 July 2012 13:31, Blue Swirl wrote: >> I'm getting this error, probably because now Valgrind support is enabled: >> CC coroutine-ucontext.o >> cc1: warnings being treated as errors >> /src/qemu/coroutine-ucontext.c:204: error: unknown option after >> '#pragma GCC diagnostic' kind >> /src/qemu/coroutine-ucontext.c:209: error: unknown option after >> '#pragma GCC diagnostic' kind >> >> Maybe the compiler does not understand this pragma and Valgrind check >> should also fail in that case. > > Yeah, I think this is one of the few tests which want to explicitly > check "is this construct going to provoke a compiler warning" -- > fix is for that test to explictly put -Werror in the cflags in > the compile_prog line. Now with your Xen configure patches in place, I'm not getting errors with this applied except for Clang (which I didn't test earlier). Maybe this should be applied. clang -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -o /tmp/qemu-conf--25992-.exe /tmp/qemu-conf--25992-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g /tmp/qemu-conf--25992-.c:4:32: warning: self-comparison always evaluates to true [-Wtautological-compare] int main(void) { return preadv == preadv; } ^ 1 warning generated. clang -Werror -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -o /tmp/qemu-conf--25992-.exe /tmp/qemu-conf--25992-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g /tmp/qemu-conf--25992-.c:4:32: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare] int main(void) { return preadv == preadv; } ^ 1 error generated. ERROR: configure test passed without -Werror but failed with -Werror. clang -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -o /tmp/qemu-conf--25992-.exe /tmp/qemu-conf--25992-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g /tmp/qemu-conf--25992-.c:13:26: warning: self-comparison always evaluates to true [-Wtautological-compare] return epoll_create1 == epoll_create1; ^ 1 warning generated. clang -Werror -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -o /tmp/qemu-conf--25992-.exe /tmp/qemu-conf--25992-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g /tmp/qemu-conf--25992-.c:13:26: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare] return epoll_create1 == epoll_create1; ^ 1 error generated. ERROR: configure test passed without -Werror but failed with -Werror. clang -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -I/usr/include/nss -I/usr/include/nspr -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -o /tmp/qemu-conf--25992-.exe /tmp/qemu-conf--25992-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g /tmp/qemu-conf--25992-.c:3:13: warning: explicitly assigning a variable of type 'char **' to itself [-Wself-assign] environ = environ; ~~~~~~~ ^ ~~~~~~~ 1 warning generated. clang -Werror -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -I/usr/include/nss -I/usr/include/nspr -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -o /tmp/qemu-conf--25992-.exe /tmp/qemu-conf--25992-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g /tmp/qemu-conf--25992-.c:3:13: error: explicitly assigning a variable of type 'char **' to itself [-Werror,-Wself-assign] environ = environ; ~~~~~~~ ^ ~~~~~~~ 1 error generated. ERROR: configure test passed without -Werror but failed with -Werror. I used this hack to get more than one warning: diff --git a/configure b/configure index d8ec050..eb2ed2f 100755 --- a/configure +++ b/configure @@ -46,11 +46,11 @@ do_cc() { esac echo $cc -Werror "$@" >> config.log $cc -Werror "$@" >> config.log 2>&1 && return $? - echo "ERROR: configure test passed without -Werror but failed with -Werror." - echo "This is probably a bug in the configure script. The failing command" - echo "will be at the bottom of config.log." - echo "You can run configure with --disable-werror to bypass this check." - exit 1 + echo "ERROR: configure test passed without -Werror but failed with -Werror." >> config.log + echo "This is probably a bug in the configure script. The failing command" >> config.log + echo "will be at the bottom of config.log." >> config.log + echo "You can run configure with --disable-werror to bypass this check." >> config.log +# exit 1 } compile_object() { > > -- PMM