* [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls @ 2013-04-15 2:31 Alexey Kardashevskiy 2013-04-15 7:08 ` Markus Armbruster 2013-04-15 7:18 ` Peter Maydell 0 siblings, 2 replies; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 2:31 UTC (permalink / raw) To: qemu-devel Cc: Peter Maydell, Alexey Kardashevskiy, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson The assert.h header file from Fedora18 does not have #ifdef-#endif brackets around __assertXXXX function so it cannot compile with the -Wredundant-decls switch on. Some Linux distributions (such as Debian Wheezy) still do have those brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but the version of assert.h on http://sourceware.org/git/?p=glibc.git does not so we should not be using -Wredundant-decls. The patch removes it. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- include/ui/qemu-pixman.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h index b032f52..6f473f9 100644 --- a/include/ui/qemu-pixman.h +++ b/include/ui/qemu-pixman.h @@ -7,13 +7,7 @@ #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 "qemu/typedefs.h" -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 2:31 [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls Alexey Kardashevskiy @ 2013-04-15 7:08 ` Markus Armbruster 2013-04-15 7:12 ` Alexey Kardashevskiy 2013-04-15 7:18 ` Peter Maydell 1 sibling, 1 reply; 31+ messages in thread From: Markus Armbruster @ 2013-04-15 7:08 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Alexey Kardashevskiy <aik@ozlabs.ru> writes: > The assert.h header file from Fedora18 does not have #ifdef-#endif > brackets around __assertXXXX function so it cannot compile with > the -Wredundant-decls switch on. > > Some Linux distributions (such as Debian Wheezy) still do have those > brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but > the version of assert.h on http://sourceware.org/git/?p=glibc.git does not > so we should not be using -Wredundant-decls. > > The patch removes it. > > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> > --- > include/ui/qemu-pixman.h | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h > index b032f52..6f473f9 100644 > --- a/include/ui/qemu-pixman.h > +++ b/include/ui/qemu-pixman.h > @@ -7,13 +7,7 @@ > #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 "qemu/typedefs.h" Patch description doesn't seem to fit the patch. The patch doesn't remove -Wredundant-decls, it removes its suppression in one specific place. Please advise. Oh, and use a spell-checker :) ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 7:08 ` Markus Armbruster @ 2013-04-15 7:12 ` Alexey Kardashevskiy 2013-04-15 8:23 ` Markus Armbruster 0 siblings, 1 reply; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 7:12 UTC (permalink / raw) To: Markus Armbruster Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/15/2013 05:08 PM, Markus Armbruster wrote: > Alexey Kardashevskiy <aik@ozlabs.ru> writes: > >> The assert.h header file from Fedora18 does not have #ifdef-#endif >> brackets around __assertXXXX function so it cannot compile with >> the -Wredundant-decls switch on. >> >> Some Linux distributions (such as Debian Wheezy) still do have those >> brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but >> the version of assert.h on http://sourceware.org/git/?p=glibc.git does not >> so we should not be using -Wredundant-decls. >> >> The patch removes it. >> >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> >> --- >> include/ui/qemu-pixman.h | 6 ------ >> 1 file changed, 6 deletions(-) >> >> diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h >> index b032f52..6f473f9 100644 >> --- a/include/ui/qemu-pixman.h >> +++ b/include/ui/qemu-pixman.h >> @@ -7,13 +7,7 @@ >> #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 "qemu/typedefs.h" > > Patch description doesn't seem to fit the patch. The patch doesn't > remove -Wredundant-decls, it removes its suppression in one specific > place. Please advise. The patch removes both suppression AND enabling, the second chunk enabled this check back after #include, no matter if it was enabled or not. > Oh, and use a spell-checker :) The one build into thunderbird does not show any spelling errors (except file names, of course) :) -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 7:12 ` Alexey Kardashevskiy @ 2013-04-15 8:23 ` Markus Armbruster 2013-04-15 9:50 ` Alexey Kardashevskiy 0 siblings, 1 reply; 31+ messages in thread From: Markus Armbruster @ 2013-04-15 8:23 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Alexey Kardashevskiy <aik@ozlabs.ru> writes: > On 04/15/2013 05:08 PM, Markus Armbruster wrote: >> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >> >>> The assert.h header file from Fedora18 does not have #ifdef-#endif >>> brackets around __assertXXXX function so it cannot compile with >>> the -Wredundant-decls switch on. >>> >>> Some Linux distributions (such as Debian Wheezy) still do have those >>> brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but >>> the version of assert.h on http://sourceware.org/git/?p=glibc.git does not >>> so we should not be using -Wredundant-decls. >>> >>> The patch removes it. >>> >>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> >>> --- >>> include/ui/qemu-pixman.h | 6 ------ >>> 1 file changed, 6 deletions(-) >>> >>> diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h >>> index b032f52..6f473f9 100644 >>> --- a/include/ui/qemu-pixman.h >>> +++ b/include/ui/qemu-pixman.h >>> @@ -7,13 +7,7 @@ >>> #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 "qemu/typedefs.h" >> >> Patch description doesn't seem to fit the patch. The patch doesn't >> remove -Wredundant-decls, it removes its suppression in one specific >> place. Please advise. > > The patch removes both suppression AND enabling, the second chunk > enabled this check back after #include, no matter if it was enabled or > not. Trouble is there is no second chunk. If you're proposing to remove -Wredundant-decls globally, you'll have to explain what problems exactly it causes. >> Oh, and use a spell-checker :) > > The one build into thunderbird does not show any spelling errors > (except file names, of course) :) arounb -Wredundand-decls ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 8:23 ` Markus Armbruster @ 2013-04-15 9:50 ` Alexey Kardashevskiy 2013-04-15 10:01 ` Peter Maydell 0 siblings, 1 reply; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 9:50 UTC (permalink / raw) To: Markus Armbruster Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/15/2013 06:23 PM, Markus Armbruster wrote: > Alexey Kardashevskiy <aik@ozlabs.ru> writes: > >> On 04/15/2013 05:08 PM, Markus Armbruster wrote: >>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >>> >>>> The assert.h header file from Fedora18 does not have #ifdef-#endif >>>> brackets around __assertXXXX function so it cannot compile with >>>> the -Wredundant-decls switch on. >>>> >>>> Some Linux distributions (such as Debian Wheezy) still do have those >>>> brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but >>>> the version of assert.h on http://sourceware.org/git/?p=glibc.git does not >>>> so we should not be using -Wredundant-decls. >>>> >>>> The patch removes it. >>>> >>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> >>>> --- >>>> include/ui/qemu-pixman.h | 6 ------ >>>> 1 file changed, 6 deletions(-) >>>> >>>> diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h >>>> index b032f52..6f473f9 100644 >>>> --- a/include/ui/qemu-pixman.h >>>> +++ b/include/ui/qemu-pixman.h >>>> @@ -7,13 +7,7 @@ >>>> #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 "qemu/typedefs.h" >>> >>> Patch description doesn't seem to fit the patch. The patch doesn't >>> remove -Wredundant-decls, it removes its suppression in one specific >>> place. Please advise. >> >> The patch removes both suppression AND enabling, the second chunk >> enabled this check back after #include, no matter if it was enabled or >> not. > > Trouble is there is no second chunk. The patch removes 3 lines twice. The second 3 lines contain: "#pragma GCC diagnostic error "-Wredundant-decls"" This enables the check. My bad, it is not "patch" chunk. Sorry for confusing. > > If you're proposing to remove -Wredundant-decls globally, you'll have to > explain what problems exactly it causes. Besides assert.h is just broken and should not be included twice when -Wredundant-decls, I got a lot of this when did cross compilation (for ppc64 on x86_64): CC hw/bt/sdp.o In file included from /home/alexey/pcipassthru/qemu-impreza/include/qapi/qmp/qobject.h:36:0, from /home/alexey/pcipassthru/qemu-impreza/include/qapi/qmp/qdict.h:16, from /home/alexey/pcipassthru/qemu-impreza/include/ui/console.h:5, from ui/qemu-pixman.c:7: /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: error: redundant redeclaration of '__assert_fail' [-Werror=redundant-decls] /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: note: previous declaration of '__assert_fail' was here /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: error: redundant redeclaration of '__assert_perror_fail' [-Werror=redundant-decls] /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: note: previous declaration of '__assert_perror_fail' was here /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:79:13: error: redundant redeclaration of '__assert' [-Werror=redundant-decls] /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:79:13: note: previous declaration of '__assert' was here In file included from /home/alexey/pcipassthru/qemu-impreza/include/qapi/qmp/qobject.h:36:0, from /home/alexey/pcipassthru/qemu-impreza/include/qapi/qmp/qdict.h:16, from /home/alexey/pcipassthru/qemu-impreza/include/ui/console.h:5, from ui/console.c:25: If we disable that warning, I do not what we loose. The "bug" above is not a bug at all. > >>> Oh, and use a spell-checker :) >> >> The one build into thunderbird does not show any spelling errors >> (except file names, of course) :) > > arounb > -Wredundand-decls Ah. My bad :( -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 9:50 ` Alexey Kardashevskiy @ 2013-04-15 10:01 ` Peter Maydell 2013-04-15 10:40 ` Peter Maydell 2013-04-15 10:52 ` Alexey Kardashevskiy 0 siblings, 2 replies; 31+ messages in thread From: Peter Maydell @ 2013-04-15 10:01 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: > /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: > error: redundant redeclaration of '__assert_fail' [-Werror=redundant-decls] > /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: > note: previous declaration of '__assert_fail' was here > /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: > error: redundant redeclaration of '__assert_perror_fail' > [-Werror=redundant-decls] This copy of assert.h seems to be broken. The declarations should be guarded (by _ASSERT_H_DECLS in my system's copy). If it's widespread we might have to work around this. > If we disable that warning, I do not what we loose. The "bug" above is not a > bug at all. What we lose is that we are no longer informed when people inadvertently introduce redundant declarations into QEMU itself. -- PMM ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 10:01 ` Peter Maydell @ 2013-04-15 10:40 ` Peter Maydell 2013-04-15 10:52 ` Alexey Kardashevskiy 1 sibling, 0 replies; 31+ messages in thread From: Peter Maydell @ 2013-04-15 10:40 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 15 April 2013 11:01, Peter Maydell <peter.maydell@linaro.org> wrote: > This copy of assert.h seems to be broken. The declarations > should be guarded (by _ASSERT_H_DECLS in my system's copy). FWIW, the _ASSERT_H_DECLS fix appears to be a Debian specific patch (added in 2003; I can't find any record of it ever being submitted upstream). -- PMM ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 10:01 ` Peter Maydell 2013-04-15 10:40 ` Peter Maydell @ 2013-04-15 10:52 ` Alexey Kardashevskiy 2013-04-15 11:00 ` Peter Maydell 2013-04-15 12:57 ` Markus Armbruster 1 sibling, 2 replies; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 10:52 UTC (permalink / raw) To: Peter Maydell Cc: Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/15/2013 08:01 PM, Peter Maydell wrote: > On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >> error: redundant redeclaration of '__assert_fail' [-Werror=redundant-decls] >> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >> note: previous declaration of '__assert_fail' was here >> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >> error: redundant redeclaration of '__assert_perror_fail' >> [-Werror=redundant-decls] > > This copy of assert.h seems to be broken. The declarations > should be guarded (by _ASSERT_H_DECLS in my system's copy). Debian? It uses eglibc which is fork (or clone?) of glibc. > If it's widespread we might have to work around this. It is in fedora 18 and glibc's git master branch. Why "if"? And this is not it. I just managed to suppress others with -Wredundand-decls, like the one with strtold() defined twice in /usr/include/stdlib.h and /usr/include/bits/stdlib-ldbl.h and some others. I suspect I am getting these errors because I am the only person who is trying to cross compile or/and when host and target endianness differ. Does anyone do cross compilation (with different endianness?) on a regular basis? My colleagues do not :) >> If we disable that warning, I do not what we loose. The "bug" above is not a >> bug at all. > > What we lose is that we are no longer informed when people > inadvertently introduce redundant declarations into QEMU itself. -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 10:52 ` Alexey Kardashevskiy @ 2013-04-15 11:00 ` Peter Maydell 2013-04-15 11:08 ` Alexey Kardashevskiy 2013-04-15 12:57 ` Markus Armbruster 1 sibling, 1 reply; 31+ messages in thread From: Peter Maydell @ 2013-04-15 11:00 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 15 April 2013 11:52, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: > I suspect I am getting these errors because I am the only person who is > trying to cross compile or/and when host and target endianness differ. Cross compilation or otherwise should have zero effect here. You may be hitting more issues because your target libc happens to be one that not very many other people are targetting. -- PMM ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 11:00 ` Peter Maydell @ 2013-04-15 11:08 ` Alexey Kardashevskiy 2013-04-15 11:14 ` Peter Maydell 0 siblings, 1 reply; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 11:08 UTC (permalink / raw) To: Peter Maydell Cc: Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/15/2013 09:00 PM, Peter Maydell wrote: > On 15 April 2013 11:52, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >> I suspect I am getting these errors because I am the only person who >> is trying to cross compile or/and when host and target endianness >> differ. > > Cross compilation or otherwise should have zero effect here. When I build on native ppc64 system (***) with fc18, everything is ok. When I build on x86_64 with headers/libraries simply copied from the (***), I get these errors. gcc is 4.7.2 on ppc64 machine and 4.6.3..4.8.0 on x86_64 (cross compiler). > You may be hitting more issues because your target libc happens to be > one that not very many other people are targetting. Is standard glibc not popular any more? Wow. Neither RHEL (5.0+) nor Fedora (16, 18) has that _ASSERT_H_DECLS in assert.h. So what is the target for the QEMU people then? -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 11:08 ` Alexey Kardashevskiy @ 2013-04-15 11:14 ` Peter Maydell 2013-04-15 11:20 ` Alexey Kardashevskiy 0 siblings, 1 reply; 31+ messages in thread From: Peter Maydell @ 2013-04-15 11:14 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 15 April 2013 12:08, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: > On 04/15/2013 09:00 PM, Peter Maydell wrote: >> You may be hitting more issues because your target libc happens to be >> one that not very many other people are targetting. > > > Is standard glibc not popular any more? Wow. Neither RHEL (5.0+) nor Fedora > (16, 18) has that _ASSERT_H_DECLS in assert.h. So what is the target for > the QEMU people then? Well, compilation of QEMU against glibc for ppc64 probably doesn't get much testing. -- PMM ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 11:14 ` Peter Maydell @ 2013-04-15 11:20 ` Alexey Kardashevskiy 0 siblings, 0 replies; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 11:20 UTC (permalink / raw) To: Peter Maydell Cc: Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/15/2013 09:14 PM, Peter Maydell wrote: > On 15 April 2013 12:08, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >> On 04/15/2013 09:00 PM, Peter Maydell wrote: >>> You may be hitting more issues because your target libc happens to be >>> one that not very many other people are targetting. >> >> >> Is standard glibc not popular any more? Wow. Neither RHEL (5.0+) nor Fedora >> (16, 18) has that _ASSERT_H_DECLS in assert.h. So what is the target for >> the QEMU people then? > > Well, compilation of QEMU against glibc for ppc64 probably > doesn't get much testing. assert.h is exactly the same on my thinkpad (x86_64) with fedora18 as all (most?) standard headers. If I replace powerpc64-linux-gcc with the standard x86_64 gcc, I get the same error. -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 10:52 ` Alexey Kardashevskiy 2013-04-15 11:00 ` Peter Maydell @ 2013-04-15 12:57 ` Markus Armbruster 2013-04-15 13:03 ` Alexey Kardashevskiy 1 sibling, 1 reply; 31+ messages in thread From: Markus Armbruster @ 2013-04-15 12:57 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Alexey Kardashevskiy <aik@ozlabs.ru> writes: > On 04/15/2013 08:01 PM, Peter Maydell wrote: >> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>> error: redundant redeclaration of '__assert_fail' [-Werror=redundant-decls] >>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>> note: previous declaration of '__assert_fail' was here >>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >>> error: redundant redeclaration of '__assert_perror_fail' >>> [-Werror=redundant-decls] >> >> This copy of assert.h seems to be broken. The declarations >> should be guarded (by _ASSERT_H_DECLS in my system's copy). > > Debian? It uses eglibc which is fork (or clone?) of glibc. > >> If it's widespread we might have to work around this. > > It is in fedora 18 and glibc's git master branch. Why "if"? It's in Fedora 17, too, but I *don't* get a warning. Suspecting your compiler. --version? [...] ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 12:57 ` Markus Armbruster @ 2013-04-15 13:03 ` Alexey Kardashevskiy 2013-04-15 15:55 ` Markus Armbruster 0 siblings, 1 reply; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 13:03 UTC (permalink / raw) To: Markus Armbruster Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/15/2013 10:57 PM, Markus Armbruster wrote: > Alexey Kardashevskiy <aik@ozlabs.ru> writes: > >> On 04/15/2013 08:01 PM, Peter Maydell wrote: >>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>> error: redundant redeclaration of '__assert_fail' [-Werror=redundant-decls] >>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>> note: previous declaration of '__assert_fail' was here >>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >>>> error: redundant redeclaration of '__assert_perror_fail' >>>> [-Werror=redundant-decls] >>> >>> This copy of assert.h seems to be broken. The declarations >>> should be guarded (by _ASSERT_H_DECLS in my system's copy). >> >> Debian? It uses eglibc which is fork (or clone?) of glibc. >> >>> If it's widespread we might have to work around this. >> >> It is in fedora 18 and glibc's git master branch. Why "if"? > > It's in Fedora 17, too, but I *don't* get a warning. Suspecting your > compiler. --version? powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to track it down tomorrow why it all works when host and target are the same (pretty sure this is the cse) but I just do not get it... It is just me who sees obvious error in assert.h which is caused by -Wno-redundant-decls? Even if you do not hit this now, you will get there eventually. -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 13:03 ` Alexey Kardashevskiy @ 2013-04-15 15:55 ` Markus Armbruster 2013-04-15 22:48 ` Alexey Kardashevskiy 0 siblings, 1 reply; 31+ messages in thread From: Markus Armbruster @ 2013-04-15 15:55 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Alexey Kardashevskiy <aik@ozlabs.ru> writes: > On 04/15/2013 10:57 PM, Markus Armbruster wrote: >> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >> >>> On 04/15/2013 08:01 PM, Peter Maydell wrote: >>>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>> error: redundant redeclaration of '__assert_fail' [-Werror=redundant-decls] >>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>> note: previous declaration of '__assert_fail' was here >>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >>>>> error: redundant redeclaration of '__assert_perror_fail' >>>>> [-Werror=redundant-decls] >>>> >>>> This copy of assert.h seems to be broken. The declarations >>>> should be guarded (by _ASSERT_H_DECLS in my system's copy). >>> >>> Debian? It uses eglibc which is fork (or clone?) of glibc. >>> >>>> If it's widespread we might have to work around this. >>> >>> It is in fedora 18 and glibc's git master branch. Why "if"? >> >> It's in Fedora 17, too, but I *don't* get a warning. Suspecting your >> compiler. --version? > > > powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to > track it down tomorrow why it all works when host and target are the > same (pretty sure this is the cse) but I just do not get it... It is > just me who sees obvious error in assert.h which is caused by > -Wno-redundant-decls? Even if you do not hit this now, you will get > there eventually. I don't doubt your gcc+libc is in error. I just don't want to lose a useful warning because of that. Workaround: configure --disable-werror ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 15:55 ` Markus Armbruster @ 2013-04-15 22:48 ` Alexey Kardashevskiy 2013-04-16 3:16 ` Alexey Kardashevskiy 2013-04-16 9:00 ` Markus Armbruster 0 siblings, 2 replies; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 22:48 UTC (permalink / raw) To: Markus Armbruster Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/16/2013 01:55 AM, Markus Armbruster wrote: > Alexey Kardashevskiy <aik@ozlabs.ru> writes: > >> On 04/15/2013 10:57 PM, Markus Armbruster wrote: >>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >>> >>>> On 04/15/2013 08:01 PM, Peter Maydell wrote: >>>>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>> error: redundant redeclaration of '__assert_fail' [-Werror=redundant-decls] >>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>> note: previous declaration of '__assert_fail' was here >>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >>>>>> error: redundant redeclaration of '__assert_perror_fail' >>>>>> [-Werror=redundant-decls] >>>>> >>>>> This copy of assert.h seems to be broken. The declarations >>>>> should be guarded (by _ASSERT_H_DECLS in my system's copy). >>>> >>>> Debian? It uses eglibc which is fork (or clone?) of glibc. >>>> >>>>> If it's widespread we might have to work around this. >>>> >>>> It is in fedora 18 and glibc's git master branch. Why "if"? >>> >>> It's in Fedora 17, too, but I *don't* get a warning. Suspecting your >>> compiler. --version? >> >> >> powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to >> track it down tomorrow why it all works when host and target are the >> same (pretty sure this is the cse) but I just do not get it... It is >> just me who sees obvious error in assert.h which is caused by >> -Wno-redundant-decls? Even if you do not hit this now, you will get >> there eventually. > > I don't doubt your gcc+libc is in error. I just don't want to lose a > useful warning because of that. > > Workaround: configure --disable-werror This workaround does NOT work if pragmas used. "#pragma GCC diagnostic error "-Wredundant-decls"" re-enables warnings as errors. -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 22:48 ` Alexey Kardashevskiy @ 2013-04-16 3:16 ` Alexey Kardashevskiy 2013-04-16 7:57 ` Markus Armbruster 2013-04-16 9:00 ` Markus Armbruster 1 sibling, 1 reply; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-16 3:16 UTC (permalink / raw) To: Markus Armbruster Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/16/2013 08:48 AM, Alexey Kardashevskiy wrote: > On 04/16/2013 01:55 AM, Markus Armbruster wrote: >> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >> >>> On 04/15/2013 10:57 PM, Markus Armbruster wrote: >>>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >>>> >>>>> On 04/15/2013 08:01 PM, Peter Maydell wrote: >>>>>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>>> >>>>>>> error: redundant redeclaration of '__assert_fail' >>>>>>> [-Werror=redundant-decls] >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>>> >>>>>>> note: previous declaration of '__assert_fail' was here >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >>>>>>> >>>>>>> error: redundant redeclaration of '__assert_perror_fail' >>>>>>> [-Werror=redundant-decls] >>>>>> >>>>>> This copy of assert.h seems to be broken. The declarations >>>>>> should be guarded (by _ASSERT_H_DECLS in my system's copy). >>>>> >>>>> Debian? It uses eglibc which is fork (or clone?) of glibc. >>>>> >>>>>> If it's widespread we might have to work around this. >>>>> >>>>> It is in fedora 18 and glibc's git master branch. Why "if"? >>>> >>>> It's in Fedora 17, too, but I *don't* get a warning. Suspecting your >>>> compiler. --version? >>> >>> >>> powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to >>> track it down tomorrow why it all works when host and target are the >>> same (pretty sure this is the cse) but I just do not get it... It is >>> just me who sees obvious error in assert.h which is caused by >>> -Wno-redundant-decls? Even if you do not hit this now, you will get >>> there eventually. >> >> I don't doubt your gcc+libc is in error. I just don't want to lose a >> useful warning because of that. > > >> Workaround: configure --disable-werror > > This workaround does NOT work if pragmas used. "#pragma GCC diagnostic > error "-Wredundant-decls"" re-enables warnings as errors. Kind of offtopic but still... I think this is just beautiful. Fedora18, x86_64, NO cross compiler. gcc does not apply -Wredundant-decls to /usr/include/* but does it for all other headers and in the case of cross compilation I hit this case. Does anyone know the way to tell gcc that libc headers are not at /usr/include but somewhere else? [aik@aik ~]$ cp /usr/include/assert.h ./ [aik@aik ~]$ [aik@aik ~]$ cat a.c #pragma GCC diagnostic error "-Wredundant-decls" #ifdef USEMINE #include "assert.h" #include "assert.h" #else #include <assert.h> #include <assert.h> #endif int main(int argc, char **argv){ return 0; } [aik@aik ~]$ [aik@aik ~]$ gcc a.c -o a [aik@aik ~]$ gcc a.c -o a -DUSEMINE In file included from a.c:5:0: assert.h:68:13: error: redundant redeclaration of ‘__assert_fail’ [-Werror=redundant-decls] In file included from a.c:4:0: assert.h:68:13: note: previous declaration of ‘__assert_fail’ was here In file included from a.c:5:0: assert.h:73:13: error: redundant redeclaration of ‘__assert_perror_fail’ [-Werror=redundant-decls] In file included from a.c:4:0: assert.h:73:13: note: previous declaration of ‘__assert_perror_fail’ was here In file included from a.c:5:0: assert.h:80:13: error: redundant redeclaration of ‘__assert’ [-Werror=redundant-decls] In file included from a.c:4:0: assert.h:80:13: note: previous declaration of ‘__assert’ was here cc1: some warnings being treated as errors [aik@aik ~]$ -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 3:16 ` Alexey Kardashevskiy @ 2013-04-16 7:57 ` Markus Armbruster 2013-04-16 9:22 ` Paolo Bonzini 0 siblings, 1 reply; 31+ messages in thread From: Markus Armbruster @ 2013-04-16 7:57 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, Paolo Bonzini, David Gibson Gcc issue, perhaps Paolo [cc'ed] got an idea. Alexey Kardashevskiy <aik@ozlabs.ru> writes: > On 04/16/2013 08:48 AM, Alexey Kardashevskiy wrote: >> On 04/16/2013 01:55 AM, Markus Armbruster wrote: >>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >>> >>>> On 04/15/2013 10:57 PM, Markus Armbruster wrote: >>>>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >>>>> >>>>>> On 04/15/2013 08:01 PM, Peter Maydell wrote: >>>>>>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>>>> >>>>>>>> error: redundant redeclaration of '__assert_fail' >>>>>>>> [-Werror=redundant-decls] >>>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>>>> >>>>>>>> note: previous declaration of '__assert_fail' was here >>>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >>>>>>>> >>>>>>>> error: redundant redeclaration of '__assert_perror_fail' >>>>>>>> [-Werror=redundant-decls] >>>>>>> >>>>>>> This copy of assert.h seems to be broken. The declarations >>>>>>> should be guarded (by _ASSERT_H_DECLS in my system's copy). >>>>>> >>>>>> Debian? It uses eglibc which is fork (or clone?) of glibc. >>>>>> >>>>>>> If it's widespread we might have to work around this. >>>>>> >>>>>> It is in fedora 18 and glibc's git master branch. Why "if"? >>>>> >>>>> It's in Fedora 17, too, but I *don't* get a warning. Suspecting your >>>>> compiler. --version? >>>> >>>> >>>> powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to >>>> track it down tomorrow why it all works when host and target are the >>>> same (pretty sure this is the cse) but I just do not get it... It is >>>> just me who sees obvious error in assert.h which is caused by >>>> -Wno-redundant-decls? Even if you do not hit this now, you will get >>>> there eventually. >>> >>> I don't doubt your gcc+libc is in error. I just don't want to lose a >>> useful warning because of that. >> > >>> Workaround: configure --disable-werror >> >> This workaround does NOT work if pragmas used. "#pragma GCC diagnostic >> error "-Wredundant-decls"" re-enables warnings as errors. > > > Kind of offtopic but still... > > I think this is just beautiful. Fedora18, x86_64, NO cross > compiler. gcc does not apply -Wredundant-decls to /usr/include/* but > does it for all other headers and in the case of cross compilation I > hit this case. > > Does anyone know the way to tell gcc that libc headers are not at > /usr/include but somewhere else? > > > > [aik@aik ~]$ cp /usr/include/assert.h ./ > [aik@aik ~]$ > [aik@aik ~]$ cat a.c > #pragma GCC diagnostic error "-Wredundant-decls" > > #ifdef USEMINE > #include "assert.h" > #include "assert.h" > #else > #include <assert.h> > #include <assert.h> > #endif > > int main(int argc, char **argv){ return 0; } > [aik@aik ~]$ > [aik@aik ~]$ gcc a.c -o a > [aik@aik ~]$ gcc a.c -o a -DUSEMINE > In file included from a.c:5:0: > assert.h:68:13: error: redundant redeclaration of ‘__assert_fail’ > [-Werror=redundant-decls] > In file included from a.c:4:0: > assert.h:68:13: note: previous declaration of ‘__assert_fail’ was here > In file included from a.c:5:0: > assert.h:73:13: error: redundant redeclaration of > ‘__assert_perror_fail’ [-Werror=redundant-decls] > In file included from a.c:4:0: > assert.h:73:13: note: previous declaration of ‘__assert_perror_fail’ was here > In file included from a.c:5:0: > assert.h:80:13: error: redundant redeclaration of ‘__assert’ > [-Werror=redundant-decls] > In file included from a.c:4:0: > assert.h:80:13: note: previous declaration of ‘__assert’ was here > cc1: some warnings being treated as errors > [aik@aik ~]$ ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 7:57 ` Markus Armbruster @ 2013-04-16 9:22 ` Paolo Bonzini 2013-04-16 10:29 ` Markus Armbruster 2013-04-16 10:54 ` Alexey Kardashevskiy 0 siblings, 2 replies; 31+ messages in thread From: Paolo Bonzini @ 2013-04-16 9:22 UTC (permalink / raw) To: Markus Armbruster Cc: Peter Maydell, Alexey Kardashevskiy, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Il 16/04/2013 09:57, Markus Armbruster ha scritto: >> >> I think this is just beautiful. Fedora18, x86_64, NO cross >> compiler. gcc does not apply -Wredundant-decls to /usr/include/* but >> does it for all other headers and in the case of cross compilation I >> hit this case. '-Wsystem-headers' Print warning messages for constructs found in system header files. Warnings from system headers are normally suppressed, on the assumption that they usually do not indicate real problems and would only make the compiler output harder to read. >> Does anyone know the way to tell gcc that libc headers are not at >> /usr/include but somewhere else? I think this helps: '--sysroot=DIR' Use DIR as the logical root directory for headers and libraries. For example, if the compiler normally searches for headers in '/usr/include' and libraries in '/usr/lib', it instead searches 'DIR/usr/include' and 'DIR/usr/lib'. but you shouldn't need it. Just configure your GCC with --with-sysroot=/foo and it should just work. Also: > This workaround does NOT work if pragmas used. "#pragma GCC diagnostic > error "-Wredundant-decls"" re-enables warnings as errors. The solution is to use push/pop like this: diff --git a/coroutine-ucontext.c b/coroutine-ucontext.c index 867a662..4bf2cde 100644 --- a/coroutine-ucontext.c +++ b/coroutine-ucontext.c @@ -169,6 +169,7 @@ Coroutine *qemu_coroutine_new(void) #ifdef CONFIG_VALGRIND_H #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE /* Work around an unused variable in the valgrind.h macro... */ +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif static inline void valgrind_stack_deregister(CoroutineUContext *co) @@ -176,7 +177,7 @@ static inline void valgrind_stack_deregister(CoroutineUContext *co) VALGRIND_STACK_DEREGISTER(co->valgrind_stack_id); } #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE -#pragma GCC diagnostic error "-Wunused-but-set-variable" +#pragma GCC diagnostic pop #endif #endif diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h index b032f52..882e2a3 100644 --- a/include/ui/qemu-pixman.h +++ b/include/ui/qemu-pixman.h @@ -8,11 +8,12 @@ /* pixman-0.16.0 headers have a redundant declaration */ #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #endif #include <pixman.h> #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE -#pragma GCC diagnostic error "-Wredundant-decls" +#pragma GCC diagnostic pop #endif #include "qemu/typedefs.h" Untested, feel free to resubmit with my Signed-off-by. Paolo ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 9:22 ` Paolo Bonzini @ 2013-04-16 10:29 ` Markus Armbruster 2013-04-16 10:54 ` Alexey Kardashevskiy 1 sibling, 0 replies; 31+ messages in thread From: Markus Armbruster @ 2013-04-16 10:29 UTC (permalink / raw) To: Paolo Bonzini Cc: Peter Maydell, Alexey Kardashevskiy, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Paolo Bonzini <pbonzini@redhat.com> writes: [...] >> This workaround does NOT work if pragmas used. "#pragma GCC diagnostic >> error "-Wredundant-decls"" re-enables warnings as errors. > > The solution is to use push/pop like this: > > diff --git a/coroutine-ucontext.c b/coroutine-ucontext.c > index 867a662..4bf2cde 100644 > --- a/coroutine-ucontext.c > +++ b/coroutine-ucontext.c > @@ -169,6 +169,7 @@ Coroutine *qemu_coroutine_new(void) > #ifdef CONFIG_VALGRIND_H > #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE > /* Work around an unused variable in the valgrind.h macro... */ > +#pragma GCC diagnostic push > #pragma GCC diagnostic ignored "-Wunused-but-set-variable" > #endif > static inline void valgrind_stack_deregister(CoroutineUContext *co) > @@ -176,7 +177,7 @@ static inline void > valgrind_stack_deregister(CoroutineUContext *co) > VALGRIND_STACK_DEREGISTER(co->valgrind_stack_id); > } > #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE > -#pragma GCC diagnostic error "-Wunused-but-set-variable" > +#pragma GCC diagnostic pop > #endif > #endif > > diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h > index b032f52..882e2a3 100644 > --- a/include/ui/qemu-pixman.h > +++ b/include/ui/qemu-pixman.h > @@ -8,11 +8,12 @@ > > /* pixman-0.16.0 headers have a redundant declaration */ > #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE > +#pragma GCC diagnostic push > #pragma GCC diagnostic ignored "-Wredundant-decls" > #endif > #include <pixman.h> > #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE > -#pragma GCC diagnostic error "-Wredundant-decls" > +#pragma GCC diagnostic pop > #endif > > #include "qemu/typedefs.h" > > Untested, feel free to resubmit with my Signed-off-by. > > Paolo You missed the one in ui/gtk.c. My patch covers it, and also configure. ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 9:22 ` Paolo Bonzini 2013-04-16 10:29 ` Markus Armbruster @ 2013-04-16 10:54 ` Alexey Kardashevskiy 2013-04-16 11:12 ` Paolo Bonzini 1 sibling, 1 reply; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-16 10:54 UTC (permalink / raw) To: Paolo Bonzini Cc: Peter Maydell, Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/16/2013 07:22 PM, Paolo Bonzini wrote: > Il 16/04/2013 09:57, Markus Armbruster ha scritto: >>> >>> I think this is just beautiful. Fedora18, x86_64, NO cross >>> compiler. gcc does not apply -Wredundant-decls to /usr/include/* but >>> does it for all other headers and in the case of cross compilation I >>> hit this case. > > '-Wsystem-headers' > Print warning messages for constructs found in system header files. > Warnings from system headers are normally suppressed, on the > assumption that they usually do not indicate real problems and > would only make the compiler output harder to read. > >>> Does anyone know the way to tell gcc that libc headers are not at >>> /usr/include but somewhere else? > > I think this helps: > > '--sysroot=DIR' > Use DIR as the logical root directory for headers and libraries. > For example, if the compiler normally searches for headers in > '/usr/include' and libraries in '/usr/lib', it instead searches > 'DIR/usr/include' and 'DIR/usr/lib'. > > but you shouldn't need it. Just configure your GCC with > --with-sysroot=/foo and it should just work. --sysroot helps for native compiler but does not for the cross compiler. Anyway, I tried Markus's patch, now assert.h generates just warnings which I can successfully suppress. Cool, thanks everyone :) -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 10:54 ` Alexey Kardashevskiy @ 2013-04-16 11:12 ` Paolo Bonzini 2013-04-16 11:52 ` Markus Armbruster 0 siblings, 1 reply; 31+ messages in thread From: Paolo Bonzini @ 2013-04-16 11:12 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Peter Maydell, Markus Armbruster, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Il 16/04/2013 12:54, Alexey Kardashevskiy ha scritto: >> >> but you shouldn't need it. Just configure your GCC with >> --with-sysroot=/foo and it should just work. > > > --sysroot helps for native compiler but does not for the cross compiler. That usually points at an incorrect configuration when you built GCC. > Anyway, I tried Markus's patch, now assert.h generates just warnings > which I can successfully suppress. Cool, thanks everyone :) His patch looks good. Markus, can you repost as a top-level message with my Reviewed-by? Paolo ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 11:12 ` Paolo Bonzini @ 2013-04-16 11:52 ` Markus Armbruster 0 siblings, 0 replies; 31+ messages in thread From: Markus Armbruster @ 2013-04-16 11:52 UTC (permalink / raw) To: Paolo Bonzini Cc: Peter Maydell, Alexey Kardashevskiy, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Paolo Bonzini <pbonzini@redhat.com> writes: > Il 16/04/2013 12:54, Alexey Kardashevskiy ha scritto: >>> >>> but you shouldn't need it. Just configure your GCC with >>> --with-sysroot=/foo and it should just work. >> >> >> --sysroot helps for native compiler but does not for the cross compiler. > > That usually points at an incorrect configuration when you built GCC. > >> Anyway, I tried Markus's patch, now assert.h generates just warnings >> which I can successfully suppress. Cool, thanks everyone :) > > His patch looks good. Markus, can you repost as a top-level message > with my Reviewed-by? Done. Thank you both for the testing and the review! ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 22:48 ` Alexey Kardashevskiy 2013-04-16 3:16 ` Alexey Kardashevskiy @ 2013-04-16 9:00 ` Markus Armbruster 2013-04-16 10:54 ` Alexey Kardashevskiy 2013-04-16 11:51 ` Kevin Wolf 1 sibling, 2 replies; 31+ messages in thread From: Markus Armbruster @ 2013-04-16 9:00 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Alexey Kardashevskiy <aik@ozlabs.ru> writes: > On 04/16/2013 01:55 AM, Markus Armbruster wrote: >> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >> >>> On 04/15/2013 10:57 PM, Markus Armbruster wrote: >>>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >>>> >>>>> On 04/15/2013 08:01 PM, Peter Maydell wrote: >>>>>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>>> error: redundant redeclaration of '__assert_fail' >>>>>>> [-Werror=redundant-decls] >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>>> note: previous declaration of '__assert_fail' was here >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >>>>>>> error: redundant redeclaration of '__assert_perror_fail' >>>>>>> [-Werror=redundant-decls] >>>>>> >>>>>> This copy of assert.h seems to be broken. The declarations >>>>>> should be guarded (by _ASSERT_H_DECLS in my system's copy). >>>>> >>>>> Debian? It uses eglibc which is fork (or clone?) of glibc. >>>>> >>>>>> If it's widespread we might have to work around this. >>>>> >>>>> It is in fedora 18 and glibc's git master branch. Why "if"? >>>> >>>> It's in Fedora 17, too, but I *don't* get a warning. Suspecting your >>>> compiler. --version? >>> >>> >>> powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to >>> track it down tomorrow why it all works when host and target are the >>> same (pretty sure this is the cse) but I just do not get it... It is >>> just me who sees obvious error in assert.h which is caused by >>> -Wno-redundant-decls? Even if you do not hit this now, you will get >>> there eventually. >> >> I don't doubt your gcc+libc is in error. I just don't want to lose a >> useful warning because of that. >> >> Workaround: configure --disable-werror > > This workaround does NOT work if pragmas used. "#pragma GCC diagnostic > error "-Wredundant-decls"" re-enables warnings as errors. Bummer. Could you try the appended patch? 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; diff --git a/coroutine-ucontext.c b/coroutine-ucontext.c index 867a662..4bf2cde 100644 --- a/coroutine-ucontext.c +++ b/coroutine-ucontext.c @@ -169,6 +169,7 @@ Coroutine *qemu_coroutine_new(void) #ifdef CONFIG_VALGRIND_H #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE /* Work around an unused variable in the valgrind.h macro... */ +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif static inline void valgrind_stack_deregister(CoroutineUContext *co) @@ -176,7 +177,7 @@ static inline void valgrind_stack_deregister(CoroutineUContext *co) VALGRIND_STACK_DEREGISTER(co->valgrind_stack_id); } #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE -#pragma GCC diagnostic error "-Wunused-but-set-variable" +#pragma GCC diagnostic pop #endif #endif diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h index b032f52..882e2a3 100644 --- a/include/ui/qemu-pixman.h +++ b/include/ui/qemu-pixman.h @@ -8,11 +8,12 @@ /* pixman-0.16.0 headers have a redundant declaration */ #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #endif #include <pixman.h> #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE -#pragma GCC diagnostic error "-Wredundant-decls" +#pragma GCC diagnostic pop #endif #include "qemu/typedefs.h" diff --git a/ui/gtk.c b/ui/gtk.c index 1e105e2..c2c6e38 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -38,11 +38,12 @@ #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE /* Work around an -Wstrict-prototypes warning in GTK headers */ +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-prototypes" #endif #include <gtk/gtk.h> #ifdef CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE -#pragma GCC diagnostic error "-Wstrict-prototypes" +#pragma GCC diagnostic pop #endif ^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 9:00 ` Markus Armbruster @ 2013-04-16 10:54 ` Alexey Kardashevskiy 2013-04-16 11:51 ` Kevin Wolf 1 sibling, 0 replies; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-16 10:54 UTC (permalink / raw) To: Markus Armbruster Cc: Peter Maydell, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson On 04/16/2013 07:00 PM, Markus Armbruster wrote: > Alexey Kardashevskiy <aik@ozlabs.ru> writes: > >> On 04/16/2013 01:55 AM, Markus Armbruster wrote: >>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >>> >>>> On 04/15/2013 10:57 PM, Markus Armbruster wrote: >>>>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >>>>> >>>>>> On 04/15/2013 08:01 PM, Peter Maydell wrote: >>>>>>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>>>> error: redundant redeclaration of '__assert_fail' >>>>>>>> [-Werror=redundant-decls] >>>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >>>>>>>> note: previous declaration of '__assert_fail' was here >>>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >>>>>>>> error: redundant redeclaration of '__assert_perror_fail' >>>>>>>> [-Werror=redundant-decls] >>>>>>> >>>>>>> This copy of assert.h seems to be broken. The declarations >>>>>>> should be guarded (by _ASSERT_H_DECLS in my system's copy). >>>>>> >>>>>> Debian? It uses eglibc which is fork (or clone?) of glibc. >>>>>> >>>>>>> If it's widespread we might have to work around this. >>>>>> >>>>>> It is in fedora 18 and glibc's git master branch. Why "if"? >>>>> >>>>> It's in Fedora 17, too, but I *don't* get a warning. Suspecting your >>>>> compiler. --version? >>>> >>>> >>>> powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to >>>> track it down tomorrow why it all works when host and target are the >>>> same (pretty sure this is the cse) but I just do not get it... It is >>>> just me who sees obvious error in assert.h which is caused by >>>> -Wno-redundant-decls? Even if you do not hit this now, you will get >>>> there eventually. >>> >>> I don't doubt your gcc+libc is in error. I just don't want to lose a >>> useful warning because of that. >>> >>> Workaround: configure --disable-werror >> >> This workaround does NOT work if pragmas used. "#pragma GCC diagnostic >> error "-Wredundant-decls"" re-enables warnings as errors. > > Bummer. Could you try the appended patch? Tried, works, thanks! -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 9:00 ` Markus Armbruster 2013-04-16 10:54 ` Alexey Kardashevskiy @ 2013-04-16 11:51 ` Kevin Wolf 2013-04-16 12:12 ` Markus Armbruster 1 sibling, 1 reply; 31+ messages in thread From: Kevin Wolf @ 2013-04-16 11:51 UTC (permalink / raw) To: Markus Armbruster Cc: Peter Maydell, Alexey Kardashevskiy, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Am 16.04.2013 um 11:00 hat Markus Armbruster geschrieben: > Alexey Kardashevskiy <aik@ozlabs.ru> writes: > > > On 04/16/2013 01:55 AM, Markus Armbruster wrote: > >> Alexey Kardashevskiy <aik@ozlabs.ru> writes: > >> > >>> On 04/15/2013 10:57 PM, Markus Armbruster wrote: > >>>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: > >>>> > >>>>> On 04/15/2013 08:01 PM, Peter Maydell wrote: > >>>>>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: > >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: > >>>>>>> error: redundant redeclaration of '__assert_fail' > >>>>>>> [-Werror=redundant-decls] > >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: > >>>>>>> note: previous declaration of '__assert_fail' was here > >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: > >>>>>>> error: redundant redeclaration of '__assert_perror_fail' > >>>>>>> [-Werror=redundant-decls] > >>>>>> > >>>>>> This copy of assert.h seems to be broken. The declarations > >>>>>> should be guarded (by _ASSERT_H_DECLS in my system's copy). > >>>>> > >>>>> Debian? It uses eglibc which is fork (or clone?) of glibc. > >>>>> > >>>>>> If it's widespread we might have to work around this. > >>>>> > >>>>> It is in fedora 18 and glibc's git master branch. Why "if"? > >>>> > >>>> It's in Fedora 17, too, but I *don't* get a warning. Suspecting your > >>>> compiler. --version? > >>> > >>> > >>> powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to > >>> track it down tomorrow why it all works when host and target are the > >>> same (pretty sure this is the cse) but I just do not get it... It is > >>> just me who sees obvious error in assert.h which is caused by > >>> -Wno-redundant-decls? Even if you do not hit this now, you will get > >>> there eventually. > >> > >> I don't doubt your gcc+libc is in error. I just don't want to lose a > >> useful warning because of that. > >> > >> Workaround: configure --disable-werror > > > > This workaround does NOT work if pragmas used. "#pragma GCC diagnostic > > error "-Wredundant-decls"" re-enables warnings as errors. > > Bummer. Could you try the appended patch? > > 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 Breaks gcc < 4.6, which doesn't have push/pop yet. Kevin ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-16 11:51 ` Kevin Wolf @ 2013-04-16 12:12 ` Markus Armbruster 0 siblings, 0 replies; 31+ messages in thread From: Markus Armbruster @ 2013-04-16 12:12 UTC (permalink / raw) To: Kevin Wolf Cc: Peter Maydell, Alexey Kardashevskiy, qemu-devel, Blue Swirl, Gerd Hoffmann, Stefan Hajnoczi, David Gibson Kevin Wolf <kwolf@redhat.com> writes: > Am 16.04.2013 um 11:00 hat Markus Armbruster geschrieben: >> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >> >> > On 04/16/2013 01:55 AM, Markus Armbruster wrote: >> >> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >> >> >> >>> On 04/15/2013 10:57 PM, Markus Armbruster wrote: >> >>>> Alexey Kardashevskiy <aik@ozlabs.ru> writes: >> >>>> >> >>>>> On 04/15/2013 08:01 PM, Peter Maydell wrote: >> >>>>>> On 15 April 2013 10:50, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >> >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >> >>>>>>> error: redundant redeclaration of '__assert_fail' >> >>>>>>> [-Werror=redundant-decls] >> >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:67:13: >> >>>>>>> note: previous declaration of '__assert_fail' was here >> >>>>>>> /home/alexey/pcipassthru/qemu-impreza/../lib4qemu/usr/include/assert.h:72:13: >> >>>>>>> error: redundant redeclaration of '__assert_perror_fail' >> >>>>>>> [-Werror=redundant-decls] >> >>>>>> >> >>>>>> This copy of assert.h seems to be broken. The declarations >> >>>>>> should be guarded (by _ASSERT_H_DECLS in my system's copy). >> >>>>> >> >>>>> Debian? It uses eglibc which is fork (or clone?) of glibc. >> >>>>> >> >>>>>> If it's widespread we might have to work around this. >> >>>>> >> >>>>> It is in fedora 18 and glibc's git master branch. Why "if"? >> >>>> >> >>>> It's in Fedora 17, too, but I *don't* get a warning. Suspecting your >> >>>> compiler. --version? >> >>> >> >>> >> >>> powerpc64-linux-gcc 4.6.3, 4.7.2, 4.8.0, all the same. I'll try to >> >>> track it down tomorrow why it all works when host and target are the >> >>> same (pretty sure this is the cse) but I just do not get it... It is >> >>> just me who sees obvious error in assert.h which is caused by >> >>> -Wno-redundant-decls? Even if you do not hit this now, you will get >> >>> there eventually. >> >> >> >> I don't doubt your gcc+libc is in error. I just don't want to lose a >> >> useful warning because of that. >> >> >> >> Workaround: configure --disable-werror >> > >> > This workaround does NOT work if pragmas used. "#pragma GCC diagnostic >> > error "-Wredundant-decls"" re-enables warnings as errors. >> >> Bummer. Could you try the appended patch? >> >> 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 > > Breaks gcc < 4.6, which doesn't have push/pop yet. The patch to configure makes sure push/pop works before we use it. When your gcc is too old, warnings aren't suppressed, and you may have to --disable-werror. I prefer that over breaking --disable-werror for everyone. ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 2:31 [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls Alexey Kardashevskiy 2013-04-15 7:08 ` Markus Armbruster @ 2013-04-15 7:18 ` Peter Maydell 2013-04-15 7:26 ` Alexey Kardashevskiy 1 sibling, 1 reply; 31+ messages in thread From: Peter Maydell @ 2013-04-15 7:18 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Blue Swirl, David Gibson, qemu-devel, Stefan Hajnoczi, Gerd Hoffmann On 15 April 2013 03:31, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: > The assert.h header file from Fedora18 does not have #ifdef-#endif > brackets around __assertXXXX function so it cannot compile with > the -Wredundant-decls switch on. > > Some Linux distributions (such as Debian Wheezy) still do have those > brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but > the version of assert.h on http://sourceware.org/git/?p=glibc.git does not > so we should not be using -Wredundant-decls. > > The patch removes it. This commit message seems to be missing any mention of which versions of pixman this change breaks and why it's OK now to break compiling against them... > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> > --- > include/ui/qemu-pixman.h | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h > index b032f52..6f473f9 100644 > --- a/include/ui/qemu-pixman.h > +++ b/include/ui/qemu-pixman.h > @@ -7,13 +7,7 @@ > #define QEMU_PIXMAN_H > > /* pixman-0.16.0 headers have a redundant declaration */ ...and if it's a correct change it should be removing the comment as well, since it would no longer apply. > -#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 "qemu/typedefs.h" > > -- > 1.7.10.4 thanks -- PMM ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 7:18 ` Peter Maydell @ 2013-04-15 7:26 ` Alexey Kardashevskiy 2013-04-15 7:30 ` Peter Maydell 0 siblings, 1 reply; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 7:26 UTC (permalink / raw) To: Peter Maydell Cc: Blue Swirl, David Gibson, qemu-devel, Stefan Hajnoczi, Gerd Hoffmann On 04/15/2013 05:18 PM, Peter Maydell wrote: > On 15 April 2013 03:31, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >> The assert.h header file from Fedora18 does not have #ifdef-#endif >> brackets around __assertXXXX function so it cannot compile with >> the -Wredundant-decls switch on. >> >> Some Linux distributions (such as Debian Wheezy) still do have those >> brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but >> the version of assert.h on http://sourceware.org/git/?p=glibc.git does not >> so we should not be using -Wredundant-decls. >> >> The patch removes it. > > This commit message seems to be missing any mention of > which versions of pixman this change breaks and why > it's OK now to break compiling against them... The change does not _break_ anything. By default, it will just generate warnings, but only if "-Wredundant-decls" is set. The second removed chunk in the patch is the problem as it: 1) enables -Wredundant-decls even if it was not enabled before; 2) makes -Wredundant-decls an error, not just a warning. Default assert.h shipped with Fedora Core 18 (pretty recent and popular distribution, I would say) cannot compile with -Wredundant-decls as an error so we should either avoid -Wredundant-decls or watch where we include assert.h very carefully. >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> >> --- >> include/ui/qemu-pixman.h | 6 ------ >> 1 file changed, 6 deletions(-) >> >> diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h >> index b032f52..6f473f9 100644 >> --- a/include/ui/qemu-pixman.h >> +++ b/include/ui/qemu-pixman.h >> @@ -7,13 +7,7 @@ >> #define QEMU_PIXMAN_H >> >> /* pixman-0.16.0 headers have a redundant declaration */ > > ...and if it's a correct change it should be removing the > comment as well, since it would no longer apply. > >> -#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 "qemu/typedefs.h" >> >> -- >> 1.7.10.4 > > thanks > -- PMM > -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 7:26 ` Alexey Kardashevskiy @ 2013-04-15 7:30 ` Peter Maydell 2013-04-15 7:45 ` Alexey Kardashevskiy 0 siblings, 1 reply; 31+ messages in thread From: Peter Maydell @ 2013-04-15 7:30 UTC (permalink / raw) To: Alexey Kardashevskiy Cc: Blue Swirl, David Gibson, qemu-devel, Stefan Hajnoczi, Gerd Hoffmann On 15 April 2013 08:26, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: > On 04/15/2013 05:18 PM, Peter Maydell wrote: >> >> On 15 April 2013 03:31, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>> >>> The assert.h header file from Fedora18 does not have #ifdef-#endif >>> brackets around __assertXXXX function so it cannot compile with >>> the -Wredundant-decls switch on. >>> >>> Some Linux distributions (such as Debian Wheezy) still do have those >>> brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but >>> the version of assert.h on http://sourceware.org/git/?p=glibc.git does >>> not >>> so we should not be using -Wredundant-decls. >>> >>> The patch removes it. >> >> >> This commit message seems to be missing any mention of >> which versions of pixman this change breaks and why >> it's OK now to break compiling against them... > > > > The change does not _break_ anything. The change breaks the fix that the code was put in to deal with, ie that pixman-0.16's header files generate warnings, which the default development qemu will turn into errors with -Werror, which means we won't compile. > The second removed chunk in the patch is the problem as it: > 1) enables -Wredundant-decls even if it was not enabled before; > 2) makes -Wredundant-decls an error, not just a warning. This is because not all versions of gcc have the push/pop warning pragma. > Default assert.h shipped with Fedora Core 18 (pretty recent and popular > distribution, I would say) cannot compile with -Wredundant-decls as an error This appears to be a bug in Fedora. I guess the correct workaround for that bug is going to be either: * wrap assert.h the same way we wrap pixman.h * drop -Wredundant-decls :-( -- PMM ^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls 2013-04-15 7:30 ` Peter Maydell @ 2013-04-15 7:45 ` Alexey Kardashevskiy 0 siblings, 0 replies; 31+ messages in thread From: Alexey Kardashevskiy @ 2013-04-15 7:45 UTC (permalink / raw) To: Peter Maydell Cc: Blue Swirl, David Gibson, qemu-devel, Stefan Hajnoczi, Gerd Hoffmann On 04/15/2013 05:30 PM, Peter Maydell wrote: > On 15 April 2013 08:26, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >> On 04/15/2013 05:18 PM, Peter Maydell wrote: >>> >>> On 15 April 2013 03:31, Alexey Kardashevskiy <aik@ozlabs.ru> wrote: >>>> >>>> The assert.h header file from Fedora18 does not have #ifdef-#endif >>>> brackets around __assertXXXX function so it cannot compile with >>>> the -Wredundant-decls switch on. >>>> >>>> Some Linux distributions (such as Debian Wheezy) still do have those >>>> brackets arounb __assertXXXX functions (#ifndef _ASSERT_H_DECLS) but >>>> the version of assert.h on http://sourceware.org/git/?p=glibc.git does >>>> not >>>> so we should not be using -Wredundant-decls. >>>> >>>> The patch removes it. >>> >>> >>> This commit message seems to be missing any mention of >>> which versions of pixman this change breaks and why >>> it's OK now to break compiling against them... >> >> >> >> The change does not _break_ anything. > > The change breaks the fix that the code was put in to deal with, > ie that pixman-0.16's header files generate warnings, which the > default development qemu will turn into errors with -Werror, which > means we won't compile. > >> The second removed chunk in the patch is the problem as it: >> 1) enables -Wredundant-decls even if it was not enabled before; >> 2) makes -Wredundant-decls an error, not just a warning. > > This is because not all versions of gcc have the push/pop warning > pragma. > >> Default assert.h shipped with Fedora Core 18 (pretty recent and popular >> distribution, I would say) cannot compile with -Wredundant-decls as an error > > This appears to be a bug in Fedora. Rather glibc as it is still in glibc's master branch: http://sourceware.org/git/?p=glibc.git;a=blob;f=assert/assert.h;h=1bb9b2d50f92da3b17cc0b937ecd6141a87dc196;hb=HEAD Or am I looking at wrong git? > I guess the correct workaround for that bug is going to be either: > > * wrap assert.h the same way we wrap pixman.h > * drop -Wredundant-decls :-( The second option seems less ugly. -- Alexey ^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2013-04-16 12:12 UTC | newest] Thread overview: 31+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-04-15 2:31 [Qemu-devel] [PATCH] pixman: remove -Wredundand-decls Alexey Kardashevskiy 2013-04-15 7:08 ` Markus Armbruster 2013-04-15 7:12 ` Alexey Kardashevskiy 2013-04-15 8:23 ` Markus Armbruster 2013-04-15 9:50 ` Alexey Kardashevskiy 2013-04-15 10:01 ` Peter Maydell 2013-04-15 10:40 ` Peter Maydell 2013-04-15 10:52 ` Alexey Kardashevskiy 2013-04-15 11:00 ` Peter Maydell 2013-04-15 11:08 ` Alexey Kardashevskiy 2013-04-15 11:14 ` Peter Maydell 2013-04-15 11:20 ` Alexey Kardashevskiy 2013-04-15 12:57 ` Markus Armbruster 2013-04-15 13:03 ` Alexey Kardashevskiy 2013-04-15 15:55 ` Markus Armbruster 2013-04-15 22:48 ` Alexey Kardashevskiy 2013-04-16 3:16 ` Alexey Kardashevskiy 2013-04-16 7:57 ` Markus Armbruster 2013-04-16 9:22 ` Paolo Bonzini 2013-04-16 10:29 ` Markus Armbruster 2013-04-16 10:54 ` Alexey Kardashevskiy 2013-04-16 11:12 ` Paolo Bonzini 2013-04-16 11:52 ` Markus Armbruster 2013-04-16 9:00 ` Markus Armbruster 2013-04-16 10:54 ` Alexey Kardashevskiy 2013-04-16 11:51 ` Kevin Wolf 2013-04-16 12:12 ` Markus Armbruster 2013-04-15 7:18 ` Peter Maydell 2013-04-15 7:26 ` Alexey Kardashevskiy 2013-04-15 7:30 ` Peter Maydell 2013-04-15 7:45 ` Alexey Kardashevskiy
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).