From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
QEMU Trivial <qemu-trivial@nongnu.org>,
Kamil Rytarowski <kamil@netbsd.org>,
"patches@linaro.org" <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH for-2.10] util/oslib-posix.c: Avoid warning on NetBSD
Date: Thu, 20 Jul 2017 16:10:27 -0500 [thread overview]
Message-ID: <15cdd5e0-48f8-35be-8fa3-c57bc50828f6@redhat.com> (raw)
In-Reply-To: <CAFEAcA9M0jeER9Ygg74_kQXv4CeW2_PMns7=t=Jw6sxkYhANpA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]
On 07/20/2017 03:53 PM, Peter Maydell wrote:
> On 20 July 2017 at 19:26, Eric Blake <eblake@redhat.com> wrote:
>> On 07/20/2017 11:32 AM, Peter Maydell wrote:
>>> On NetBSD the compiler warns:
>>> util/oslib-posix.c: In function 'sigaction_invoke':
>>> util/oslib-posix.c:589:5: warning: missing braces around initializer [-Wmissing-braces]
>>> siginfo_t si = { 0 };
>>> ^
>>
>> Uggh. That is a broken compiler. C99 declares that 'anything = {0}' is
>> supposed to be a valid way to zero-initialize anything.
>
> Looks like maybe it was https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
Would it be better to add a configure check for broken -Wmissing-braces
(where we would then add -Wno-missing-braces to the (outdated) NetBSD
compiler)?
But then again, we already rely on gcc/clang's extension of foo={}
(which is valid for C++, what a shame that the two languages picked
different universal-zero initializers), so it's probably less churn to
just fix the few outliers to also rely on the extension than it is to
bloat configure just to permanently work around the broken compiler.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2017-07-20 21:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 16:32 [Qemu-devel] [PATCH for-2.10] util/oslib-posix.c: Avoid warning on NetBSD Peter Maydell
2017-07-20 18:26 ` Eric Blake
2017-07-20 20:53 ` Peter Maydell
2017-07-20 21:10 ` Eric Blake [this message]
2017-07-20 21:20 ` Peter Maydell
2017-07-21 10:22 ` Peter Maydell
2017-07-21 12:18 ` [Qemu-devel] [Qemu-trivial] " Kamil Rytarowski
2017-07-21 12:54 ` Eric Blake
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=15cdd5e0-48f8-35be-8fa3-c57bc50828f6@redhat.com \
--to=eblake@redhat.com \
--cc=kamil@netbsd.org \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).