Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Paolo Bonzini
On 20/10/2017 17:32, Laszlo Ersek wrote: > On 10/20/17 17:09, Paolo Bonzini wrote: >> On 20/10/2017 17:08, Laszlo Ersek wrote: >>> My remark below might matter even less, but: >>> >>> I'd find it regrettable if we suppressed a wrong gcc warning about a >>> valid C construct by replacing the constru

Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Laszlo Ersek
On 10/20/17 17:09, Paolo Bonzini wrote: > On 20/10/2017 17:08, Laszlo Ersek wrote: >> On 10/20/17 13:02, Paolo Bonzini wrote: >>> On 20/10/2017 12:48, Peter Maydell wrote: On 20 October 2017 at 11:12, Paolo Bonzini wrote: > GCC 4.9 and newer stopped warning for missing braces around

Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Paolo Bonzini
On 20/10/2017 17:08, Laszlo Ersek wrote: > On 10/20/17 13:02, Paolo Bonzini wrote: >> On 20/10/2017 12:48, Peter Maydell wrote: >>> On 20 October 2017 at 11:12, Paolo Bonzini wrote: GCC 4.9 and newer stopped warning for missing braces around the "universal" C zero initializer {0}. One s

Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Laszlo Ersek
On 10/20/17 13:02, Paolo Bonzini wrote: > On 20/10/2017 12:48, Peter Maydell wrote: >> On 20 October 2017 at 11:12, Paolo Bonzini wrote: >>> GCC 4.9 and newer stopped warning for missing braces around the >>> "universal" C zero initializer {0}. One such initializer sneaked >>> into scsi/qemu-pr-h

Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Paolo Bonzini
On 20/10/2017 12:48, Peter Maydell wrote: > On 20 October 2017 at 11:12, Paolo Bonzini wrote: >> GCC 4.9 and newer stopped warning for missing braces around the >> "universal" C zero initializer {0}. One such initializer sneaked >> into scsi/qemu-pr-helper.c and is breaking the build with such >>

Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Peter Maydell
On 20 October 2017 at 11:12, Paolo Bonzini wrote: > GCC 4.9 and newer stopped warning for missing braces around the > "universal" C zero initializer {0}. One such initializer sneaked > into scsi/qemu-pr-helper.c and is breaking the build with such > older GCC versions. > > Detect the lack of supp

Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Laszlo Ersek
On 10/20/17 12:37, Paolo Bonzini wrote: > On 20/10/2017 12:27, Laszlo Ersek wrote: >>> +if compile_object "-Werror" "" ; then >>> + : >>> +else >> Is this an established idiom for the configure script, in place of: >> >> if ! compile_object "-Werror" "" ; then >> >> ? >> >> Looks good to me othe

Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Paolo Bonzini
On 20/10/2017 12:27, Laszlo Ersek wrote: >> +if compile_object "-Werror" "" ; then >> + : >> +else > Is this an established idiom for the configure script, in place of: > > if ! compile_object "-Werror" "" ; then > > ? > > Looks good to me otherwise. I tend not use "if !". In general that's

Re: [Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Laszlo Ersek
On 10/20/17 12:12, Paolo Bonzini wrote: > GCC 4.9 and newer stopped warning for missing braces around the > "universal" C zero initializer {0}. One such initializer sneaked s/sneaked/snuck/ Hmmm, no, wait, both forms are valid! https://en.wiktionary.org/wiki/sneaked https://en.wiktionary.org/wi

[Qemu-devel] [PATCH] build: disable -Wmissing-braces on older compilers

2017-10-20 Thread Paolo Bonzini
GCC 4.9 and newer stopped warning for missing braces around the "universal" C zero initializer {0}. One such initializer sneaked into scsi/qemu-pr-helper.c and is breaking the build with such older GCC versions. Detect the lack of support for the idiom, and disable the warning in that case. Sign