On 07/20/2017 03:53 PM, Peter Maydell wrote: > On 20 July 2017 at 19:26, Eric Blake <ebl...@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
signature.asc
Description: OpenPGP digital signature