From: Stefan Weil <sw@weilnetz.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Blue Swirl <blauwirbel@gmail.com>,
qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] configure: Disable (clang) initializer-overrides warnings
Date: Tue, 16 Oct 2012 22:20:25 +0200 [thread overview]
Message-ID: <507DC189.4060107@weilnetz.de> (raw)
In-Reply-To: <CAFEAcA9Br9tfHgoeCHVjOzj6_o4sCMA36hguieju6W=Ty-AKxg@mail.gmail.com>
Am 14.10.2012 22:24, schrieb Peter Maydell:
> On 14 October 2012 21:15, Blue Swirl<blauwirbel@gmail.com> wrote:
>> On Sun, Oct 14, 2012 at 8:00 PM, Peter Maydell<peter.maydell@linaro.org> wrote:
>>> Blue Swirl previously submitted a patch which enabled this flag
>>> (among others):
>>> http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg04203.html
>>
>> In my version, Clang flags were separate from GCC flags. I think it
>> would be better to run different tests for each compiler in the
>> future, that lets GCC avoid Clang flag -ffoobar which does not have
>> desirable effect to GCC and vice versa.
>
> Mmm, but at the moment it's entirely fine to pass both compilers
> the same flags, and moreover we actually pass all these flags
> to the compiler without checking if it's gcc or not; we just
> ask if the compiler will run OK with the flag passed. (I'm not
> even sure how you'd determine whether your compiler was gcc
> or clang or gcc-llvm or whatever...)
>
>> I'd also like to handle flags for sparse checker the same way.
>
> I agree that those bits of configure could be cleaner.
>
> -- PMM
>
Hi Peter, hi Blue,
gcc uses a different flag -Wno-override-init to disable initializer
override warnings.
I tested the following patch which uses -Wextra with gcc-4.4 and gcc-4.7.
It allows compilation of QEMU without warnings.
A test with those flags and clang still has to be done.
Regards
Stefan W.
diff --git a/configure b/configure
index 359e453..0818eda 100755
--- a/configure
+++ b/configure
@@ -267,6 +267,8 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes
$QEMU_CFLAGS"
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
+QEMU_CFLAGS="-Wextra -Wno-missing-field-initializers $QEMU_CFLAGS"
+QEMU_CFLAGS="-Wno-override-init -Wno-sign-compare -Wno-unused-parameter
$QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
$QEMU_CFLAGS"
QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu"
if test "$debug_info" = "yes"; then
next prev parent reply other threads:[~2012-10-16 20:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-14 20:00 [Qemu-devel] [PATCH] configure: Disable (clang) initializer-overrides warnings Peter Maydell
2012-10-14 20:15 ` Blue Swirl
2012-10-14 20:24 ` Peter Maydell
2012-10-16 20:20 ` Stefan Weil [this message]
2012-10-16 21:19 ` Peter Maydell
2012-10-24 12:31 ` Peter Maydell
2012-10-27 16:51 ` Blue Swirl
2012-10-27 20:32 ` Igor Mitsyanko
2012-10-27 21:12 ` Peter Maydell
2012-10-27 21:24 ` Stefan Weil
2012-10-27 21:35 ` Peter Maydell
2012-10-27 21:46 ` Stefan Weil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=507DC189.4060107@weilnetz.de \
--to=sw@weilnetz.de \
--cc=blauwirbel@gmail.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).