Eric Blake <ebl...@redhat.com> writes: > On 04/16/2013 05:51 AM, Markus Armbruster wrote: >> Replace >> >> #pragma GCC diagnostic ignored FOO >> [Troublesome code...] >> #pragma GCC diagnostic error FOO >> >> by >> >> #pragma GCC diagnostic push >> #pragma GCC diagnostic ignored FOO >> [Troublesome code...] >> #pragma GCC diagnostic pop > > Older gcc does not understand #pragma GCC diagnostic push. Are you sure > this solution works with all versions of gcc in common use for compiling > qemu?
The first patch hunk should take care of the problem: diff --git a/configure b/configure index 0788e27..41097a2 100755 --- a/configure +++ b/configure @@ -3244,8 +3244,10 @@ fi pragma_disable_unused_but_set=no cat > $TMPC << EOF +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic pop int main(void) { return 0; If gcc chokes on push/pop, we simply refrain from suppressing warnings. You may have to --disable-werror then. I prefer that over breaking --disable-werror for everyone. Testing with a suitably antique gcc appreciated!