qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Igor Mitsyanko <i.mitsyanko@gmail.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] configure: Disable (clang) initializer-overrides warnings
Date: Sat, 27 Oct 2012 23:24:14 +0200	[thread overview]
Message-ID: <508C50FE.5070003@weilnetz.de> (raw)
In-Reply-To: <508C44C0.8070301@gmail.com>

Am 27.10.2012 22:32, schrieb Igor Mitsyanko:
> On 10/27/2012 8:51 PM, Blue Swirl wrote:
>> Thanks, applied.
>>
>> On Sun, Oct 14, 2012 at 8:00 PM, Peter Maydell 
>> <peter.maydell@linaro.org> wrote:
>>> Disable clang's initializer-overrides warnings, as QEMU makes 
>>> significant
>>> use of the pattern of initializing an array with a range-based default
>>> entry like
>>>      [0 ... 0x1ff] = { GPIO_NONE, 0 }
>>> followed by specific entries which override that default, and clang
>>> would otherwise warn "initializer overrides prior initialization of
>>> this subobject" when it encountered the specific entry.
>>>
>>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>>> ---
>>> This is basically a judgement that our coding style is legitimate
>>> and the compiler is being overly alarmist. I don't think we would
>>> benefit from trying to silence the warnings and I can't think of
>>> a clean way of doing so...
>>>
>>> NB that gcc will happily ignore -Wno-wombat warnings that it doesn't
>>> happen to recognize. (For compilers that don't accept-and-ignore the 
>>> flag
>>> configure will identify this and not use it.)
>>>
>
> I encountered strange behavior of latest mingw gcc, it ignores 
> unrecognized -Wno-wombat options only in case if no other warnings are 
> issued (configure gccflags test doesn't issue any), otherwise I get this:
>
> cc1.exe: warning: unrecognized command line option 
> "-Wno-initializer-overrides" [enabled by default]
>
> This is probably a bug in mingw GCC (or perhaps I'm using it wrong), 
> but anyway, this makes QEMU mingw build output very noisy.

This "feature" of gcc is not restricted to MinGW nor to a special 
version of gcc
but can also occur on Linux.
Normally, you don't see it there because QEMU compiles without warnings 
on Linux
while there are more or less warnings on MinGW.

It looks like we need a better test for compiler options.
Here are several possible solutions for this test:

* Run the compiler with all compiler options + at least one unsupported 
option.
   It will complain and list all invalid options. Remove those from the 
list.
   This solution needs a fallback to the current solution if the compiler's
   error output does not include the invalid options.

* Run $cc --help=warnings and look for each warning option in the 
resulting list.
   -fstack-protector-all is not a warning option and needs special handling.
   This solution needs a fallback to the current solution if the 
compiler does
   not support --help=warning (clang does not).

* Get the compiler and its version and set the options according to the 
specification.
   This is more work than the other two solutions.

A nice side effect of the first two solutions would be that they can 
reduce the
time needed for configure in the usual environment with gcc (but not 
with clang).

Regards

Stefan Weil

  parent reply	other threads:[~2012-10-27 21:24 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
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 [this message]
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=508C50FE.5070003@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=blauwirbel@gmail.com \
    --cc=i.mitsyanko@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).