]> git.proxmox.com Git - mirror_qemu.git/commit - util/coroutine-ucontext.c
build: try improve handling of clang warnings
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 9 Mar 2018 13:59:45 +0000 (14:59 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 12 Mar 2018 07:59:03 +0000 (08:59 +0100)
commit0e39c4aa7ecc5699bc391fcb1dceed88d077e99d
tree9e951de075ebb37a876533805ddf5cd97de9aa4c
parente4ae62b802cec437f877f2cadc4ef059cc0eca76
build: try improve handling of clang warnings

This patch disables the pragma diagnostic -Wunused-but-set-variable for
clang in util/coroutine-ucontext.c.

This in turn allows us to remove it from the configure check, so the
CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE will succeed for clang.

With that in place clang builds (linux) will use -Werror by default,
which breaks the build due to warning about unaligned struct members.

Just turning off this warning isn't a good idea as it indicates
portability problems.  So make it a warning again, using
-Wno-error=address-of-packed-member.  That way it doesn't break the
build but still shows up in the logs.

Now clang builds qemu without errors.  Well, almost.  There are some
left in the rdma code.  Leaving that to the rdma people.  All others can
use --disable-rdma to workarounds this.

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20180309135945.20436-1-kraxel@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
configure
util/coroutine-ucontext.c