Skip to content

Commit e6f53fd

Browse files
Markus ArmbrusterAnthony Liguori
Markus Armbruster
authored and
Anthony Liguori
committed
Fix warnings suppressors to honor --disable-werror
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 Broken in commit 3f4349d, commit 092bb30, and commit c95e308. Signed-off-by: Markus Armbruster <[email protected]> Tested-by: Alexey Kardashevskiy <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Message-id: [email protected] Signed-off-by: Anthony Liguori <[email protected]>
1 parent bf2a38d commit e6f53fd

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,8 +3268,10 @@ fi
32683268

32693269
pragma_disable_unused_but_set=no
32703270
cat > $TMPC << EOF
3271+
#pragma GCC diagnostic push
32713272
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
32723273
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
3274+
#pragma GCC diagnostic pop
32733275
32743276
int main(void) {
32753277
return 0;

coroutine-ucontext.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,15 @@ Coroutine *qemu_coroutine_new(void)
169169
#ifdef CONFIG_VALGRIND_H
170170
#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
171171
/* Work around an unused variable in the valgrind.h macro... */
172+
#pragma GCC diagnostic push
172173
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
173174
#endif
174175
static inline void valgrind_stack_deregister(CoroutineUContext *co)
175176
{
176177
VALGRIND_STACK_DEREGISTER(co->valgrind_stack_id);
177178
}
178179
#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
179-
#pragma GCC diagnostic error "-Wunused-but-set-variable"
180+
#pragma GCC diagnostic pop
180181
#endif
181182
#endif
182183

include/ui/qemu-pixman.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
/* pixman-0.16.0 headers have a redundant declaration */
1010
#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
11+
#pragma GCC diagnostic push
1112
#pragma GCC diagnostic ignored "-Wredundant-decls"
1213
#endif
1314
#include <pixman.h>
1415
#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
15-
#pragma GCC diagnostic error "-Wredundant-decls"
16+
#pragma GCC diagnostic pop
1617
#endif
1718

1819
#include "qemu/typedefs.h"

ui/gtk.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@
3838

3939
#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
4040
/* Work around an -Wstrict-prototypes warning in GTK headers */
41+
#pragma GCC diagnostic push
4142
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
4243
#endif
4344
#include <gtk/gtk.h>
4445
#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
45-
#pragma GCC diagnostic error "-Wstrict-prototypes"
46+
#pragma GCC diagnostic pop
4647
#endif
4748

4849

0 commit comments

Comments
 (0)