gcc: rename CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET to CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
PATCH 1/2 gcc: rename CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET to CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE
--- configure | 6 +++--- coroutine-ucontext.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
configure +3 -3
@@ -3078,7 +3078,7 @@ int main(void) { } EOF if compile_prog "-Werror" "" ; then - pragma_disable_unused_but_set=yes + pragma_diagnostic_available=yes fi ########################################
@@ -3650,8 +3650,8 @@ if test "$linux_magic_h" = "yes" ; then echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak fi -if test "$pragma_disable_unused_but_set" = "yes" ; then - echo "CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET=y" >> $config_host_mak +if test "$pragma_diagnostic_available" = "yes" ; then + echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak fi if test "$valgrind_h" = "yes" ; then
coroutine-ucontext.c +2 -2
@@ -200,7 +200,7 @@ Coroutine *qemu_coroutine_new(void) }#ifdef CONFIG_VALGRIND_H -#ifdef CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE /* Work around an unused variable in the valgrind.h macro... */ #pragma GCC diagnostic ignored "-Wunused-but-set-variable"#endif
@@ -208,7 +208,7 @@ static inline void valgrind_stack_deregister(CoroutineUContext *co) {VALGRIND_STACK_DEREGISTER (co->valgrind_stack_id); } -#ifdef CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE #pragma GCC diagnostic error "-Wunused-but-set-variable"#endif #endif
Signature · 1 line
1.7.1
PATCH 2/2 pixman: fix warning
--- include/ui/qemu-pixman.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
include/ui/qemu-pixman.h +7 -0
@@ -6,7 +6,14 @@#ifndef QEMU_PIXMAN_H #define QEMU_PIXMAN_H +/* pixman-0.16.0 headers have a redundant declaration */ +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +#pragma GCC diagnostic ignored "-Wredundant-decls" +#endif #include <pixman.h> +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +#pragma GCC diagnostic error "-Wredundant-decls" +#endif #include "console.h"
Signature · 1 line
1.7.1
Blue Swirl
AppliedThanks, applied.
Quoted 56 lines · Gerd Hoffmann
Signed-off-by Gerd Hoffmann <[email protected]>--- configure | 6 +++--- coroutine-ucontext.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)configure +3
-3@@ -3078,7 +3078,7 @@ int main(void) { } EOF if compile_prog "-Werror" "" ; then - pragma_disable_unused_but_set=yes + pragma_diagnostic_available=yes fi ########################################@@ -3650,8 +3650,8 @@ if test "$linux_magic_h" = "yes" ; then echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak fi -if test "$pragma_disable_unused_but_set" = "yes" ; then - echo "CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET=y" >> $config_host_mak +if test "$pragma_diagnostic_available" = "yes" ; then + echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak fi if test "$valgrind_h" = "yes" ; thencoroutine-ucontext.c +2
-3@@ -200,7 +200,7 @@ Coroutine *qemu_coroutine_new(void) }#ifdef CONFIG_VALGRIND_H -#ifdef CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE /* Work around an unused variable in the valgrind.h macro... */ #pragma GCC diagnostic ignored "-Wunused-but-set-variable"#endif @@ -208,7 +208,7 @@ static inline void valgrind_stack_deregister(CoroutineUContext *co) {VALGRIND_STACK_DEREGISTER (co->valgrind_stack_id); } -#ifdef CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE #pragma GCC diagnostic error "-Wunused-but-set-variable"#endif #endif --1.7.1
Blue Swirl
AppliedRe: [Qemu-devel] [PATCH 2/2] pixman: fix warning
In reply to Gerd HoffmannThanks, applied.
Quoted 30 lines · Gerd Hoffmann
--- include/ui/qemu-pixman.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)include/ui/qemu-pixman.h +7
-1@@ -6,7 +6,14 @@#ifndef QEMU_PIXMAN_H #define QEMU_PIXMAN_H +/* pixman-0.16.0 headers have a redundant declaration */ +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +#pragma GCC diagnostic ignored "-Wredundant-decls" +#endif #include <pixman.h> +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +#pragma GCC diagnostic error "-Wredundant-decls" +#endif #include "console.h" --1.7.1
Re: [Qemu-devel] [PATCH 2/2] pixman: fix warning
In reply to Gerd HoffmannAm 09.01.2013 10:17, schrieb Gerd Hoffmann:
Quoted 16 lines
--- include/ui/qemu-pixman.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)include/ui/qemu-pixman.h +1
-0@@ -6,7 +6,14 @@#ifndef QEMU_PIXMAN_H #define QEMU_PIXMAN_H +/* pixman-0.16.0 headers have a redundant declaration */
include/ui/qemu-pixman.h line 19
Quoted 10 lines
include/ui/qemu-pixman.h +6
-0+#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +#pragma GCC diagnostic ignored "-Wredundant-decls" +#endif #include <pixman.h> +#ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +#pragma GCC diagnostic error "-Wredundant-decls" +#endif #include "console.h"
Unfortunately this did not help on SLES11 SP2. I don't spot any typo in your patches, it looked neat; CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE does not get defined in config-host.h it seems.
Using the pragmas unconditionally results in change from:
CC qemu-timer.o
cc1: warnings being treated as errors
In file included from /home/andreas/QEMU/qemu-s390/include/ui/qemu-pixman.h:13,
from /home/andreas/QEMU/qemu-s390/include/ui/console.h:4,
from /home/andreas/QEMU/qemu-s390/qemu-timer.c:27:/usr/include/pixman-1/pixman.h:225: error: redundant redeclaration of ‘pixman_transform_from_pixman_f_transform’ /usr/include/pixman-1/pixman.h:221: error: previous declaration of ‘pixman_transform_from_pixman_f_transform’ was here
make: *** [qemu-timer.o] Fehler 1
to:
CC qemu-timer.o
cc1: warnings being treated as errors
In file included from /home/andreas/QEMU/qemu-s390/include/ui/qemu-pixman.h:13,
from /home/andreas/QEMU/qemu-s390/include/ui/console.h:4,
from /home/andreas/QEMU/qemu-s390/qemu-timer.c:27:/usr/include/pixman-1/pixman.h:221: error: previous declaration of ‘pixman_transform_from_pixman_f_transform’ was here
make: *** [qemu-timer.o] Fehler 1
gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]
Regards,
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] [PATCH 2/2] pixman: fix warning
Hi,
Quoted 3 lines
Unfortunately this did not help on SLES11 SP2. I don't spot any typo in your patches, it looked neat;
CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLEdoes not get defined inconfig-host.hit seems.
Hmm, anything in config.log? Maybe the sles11 gcc doesn't support the -Wunused-but-set-variable used in the configure test?
Quoted 20 lines
Using the pragmas unconditionally results in change from:
CC qemu-timer.o
cc1: warnings being treated as errors
In file included from/home/andreas/QEMU/qemu-s390/include/ui/qemu-pixman.h:13,from /home/andreas/QEMU/qemu-s390/include/ui/console.h:4, from /home/andreas/QEMU/qemu-s390/qemu-timer.c:27:
/usr/include/pixman-1/pixman.h:225: error: redundant redeclaration of ‘pixman_transform_from_pixman_f_transform’/usr/include/pixman-1/pixman.h:221: error: previous declaration of ‘pixman_transform_from_pixman_f_transform’ was here
make: *** [qemu-timer.o] Fehler 1to:
CC qemu-timer.o
cc1: warnings being treated as errors
In file included from/home/andreas/QEMU/qemu-s390/include/ui/qemu-pixman.h:13,
Quoted 5 lines
from /home/andreas/QEMU/qemu-s390/include/ui/console.h:4, from /home/andreas/QEMU/qemu-s390/qemu-timer.c:27:
/usr/include/pixman-1/pixman.h:221: error: previous declaration of ‘pixman_transform_from_pixman_f_transform’ was here
make: *** [qemu-timer.o] Fehler 1
That looks like a gcc bug to me.
cheers,
Gerd
Re: [Qemu-devel] [PATCH 2/2] pixman: fix warning
Il 15/01/2013 15:29, Gerd Hoffmann ha scritto:
Quoted 25 lines
Quoted 16 lines
Quoted 16 lines
Using the pragmas unconditionally results in change from:
CC qemu-timer.o
cc1: warnings being treated as errors
In file included from/home/andreas/QEMU/qemu-s390/include/ui/qemu-pixman.h:13,from /home/andreas/QEMU/qemu-s390/include/ui/console.h:4, from /home/andreas/QEMU/qemu-s390/qemu-timer.c:27:
/usr/include/pixman-1/pixman.h:225: error: redundant redeclaration of ‘pixman_transform_from_pixman_f_transform’/usr/include/pixman-1/pixman.h:221: error: previous declaration of ‘pixman_transform_from_pixman_f_transform’ was here
make: *** [qemu-timer.o] Fehler 1to:
Quoted 9 lines
Quoted 9 lines
CC qemu-timer.o
cc1: warnings being treated as errors
In file included from/home/andreas/QEMU/qemu-s390/include/ui/qemu-pixman.h:13,from /home/andreas/QEMU/qemu-s390/include/ui/console.h:4, from /home/andreas/QEMU/qemu-s390/qemu-timer.c:27:
/usr/include/pixman-1/pixman.h:221: error: previous declaration of ‘pixman_transform_from_pixman_f_transform’ was here
make: *** [qemu-timer.o] Fehler 1
Quoted 1 line
That looks like a gcc bug to me.
Me too. CCing Richard Guenther, or whatever his surname is now :), from SuSE.
Paolo