[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix warnings suppressors to honor --disable-wer
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH] Fix warnings suppressors to honor --disable-werror |
Date: |
Tue, 16 Apr 2013 15:08:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) |
Eric Blake <address@hidden> 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!