Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Blue Swirl
On Mon, Jan 21, 2013 at 9:10 PM, Markus Armbruster wrote: > Blue Swirl writes: > >> On Mon, Jan 21, 2013 at 10:36 AM, Markus Armbruster >> wrote: >>> Peter Maydell writes: >>> On 20 January 2013 15:54, Blue Swirl wrote: >>> [...] I don't think there's much point adding tons of "XXX"

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Markus Armbruster
Blue Swirl writes: > On Mon, Jan 21, 2013 at 10:36 AM, Markus Armbruster wrote: >> Peter Maydell writes: >> >>> On 20 January 2013 15:54, Blue Swirl wrote: >> [...] >>> I don't think there's much point adding tons of "XXX" comments >>> when a bunch of these aren't actually wrong code. >> >> Mo

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Blue Swirl
On Mon, Jan 21, 2013 at 10:36 AM, Markus Armbruster wrote: > Peter Maydell writes: > >> On 20 January 2013 15:54, Blue Swirl wrote: > [...] >> I don't think there's much point adding tons of "XXX" comments >> when a bunch of these aren't actually wrong code. > > Moreover, such comments make them

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Paul Brook
> > diff --git a/disas/cris.c b/disas/cris.c > > +/* XXX: questionable fallthrough */ > > Inherited from binutils; if you want to clean this up, suggest to do it > there. Except that upstream binutils is GPLv3, so this code is effectively orphaned. Paul

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Max Filippov
On Mon, Jan 21, 2013 at 6:27 PM, Markus Armbruster wrote: > Max Filippov writes: diff --git a/target-xtensa/op_helper.c b/target-xtensa/op_helper.c index 3813a72..d829702 100644 --- a/target-xtensa/op_helper.c +++ b/target-xtensa/op_helper.c @@ -443,8 +443,10 @@ void HELP

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Markus Armbruster
Max Filippov writes: > On Mon, Jan 21, 2013 at 5:11 PM, Markus Armbruster wrote: >> Blue Swirl writes: >> >>> Recent Clang compilers have preliminary support for finding >>> unannotated fallthrough cases in switch statements with >>> compiler flag -Wimplicit-fallthrough. The support is incomple

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Max Filippov
On Mon, Jan 21, 2013 at 5:11 PM, Markus Armbruster wrote: > Blue Swirl writes: > >> Recent Clang compilers have preliminary support for finding >> unannotated fallthrough cases in switch statements with >> compiler flag -Wimplicit-fallthrough. The support is incomplete, >> it's only possible to a

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Markus Armbruster
Peter Maydell writes: > On 20 January 2013 15:54, Blue Swirl wrote: [...] > I don't think there's much point adding tons of "XXX" comments > when a bunch of these aren't actually wrong code. Moreover, such comments make them look intentional to static analyzers. I doubt lying to our tools is a

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-21 Thread Kevin Wolf
Am 20.01.2013 16:54, schrieb Blue Swirl: > Recent Clang compilers have preliminary support for finding > unannotated fallthrough cases in switch statements with > compiler flag -Wimplicit-fallthrough. The support is incomplete, > it's only possible to annotate the case in C++ but not in C, so it >

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-20 Thread Paul Brook
> I don't think there's much point adding tons of "XXX" comments > when a bunch of these aren't actually wrong code. If you want to fix > this I think a better approach would be more focused patches aimed > at adding 'break;' or "/* fallthrough */" based on actual human > examination of the surroun

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-20 Thread Peter Maydell
On 20 January 2013 17:38, Andreas Färber wrote: > Am 20.01.2013 18:26, schrieb Blue Swirl: >> On Sun, Jan 20, 2013 at 4:56 PM, Peter Maydell >> wrote: case 0x4c: /* TBR */ hw_error("TODO: Timer value read\n"); +/* XXX: questionable fallthrough */ >>> >>> This

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-20 Thread Andreas Färber
Am 20.01.2013 18:26, schrieb Blue Swirl: > On Sun, Jan 20, 2013 at 4:56 PM, Peter Maydell > wrote: >> On 20 January 2013 15:54, Blue Swirl wrote: >> >> This patch is a bit big to usefully review. A few comments on bits >> I happened to notice: [...] >>> --- a/hw/stellaris.c >>> +++ b/hw/stellari

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-20 Thread Blue Swirl
On Sun, Jan 20, 2013 at 4:56 PM, Peter Maydell wrote: > On 20 January 2013 15:54, Blue Swirl wrote: > > This patch is a bit big to usefully review. A few comments on bits > I happened to notice: > >> diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c >> index a196fcc..2066ef3 100644 >> --- a/hw/arm_s

Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-20 Thread Peter Maydell
On 20 January 2013 15:54, Blue Swirl wrote: This patch is a bit big to usefully review. A few comments on bits I happened to notice: > diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c > index a196fcc..2066ef3 100644 > --- a/hw/arm_sysctl.c > +++ b/hw/arm_sysctl.c > @@ -199,6 +199,7 @@ static void

[Qemu-devel] [PATCH] Annotate questionable fallthroughs

2013-01-20 Thread Blue Swirl
Recent Clang compilers have preliminary support for finding unannotated fallthrough cases in switch statements with compiler flag -Wimplicit-fallthrough. The support is incomplete, it's only possible to annotate the case in C++ but not in C, so it wouldn't be useful to enable the flag for QEMU yet.