From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxDDh-0003Is-W3 for qemu-devel@nongnu.org; Mon, 21 Jan 2013 03:59:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxDDg-0007lW-Fi for qemu-devel@nongnu.org; Mon, 21 Jan 2013 03:59:09 -0500 Message-ID: <50FD032D.7020601@redhat.com> Date: Mon, 21 Jan 2013 09:58:21 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <19952e84d566d9309b15fe205db6b166f4234c33.1358697255.git.blauwirbel@gmail.com> In-Reply-To: <19952e84d566d9309b15fe205db6b166f4234c33.1358697255.git.blauwirbel@gmail.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Annotate questionable fallthroughs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Peter Maydell , Anthony Liguori , Mark Langsdorf , qemu-ppc@nongnu.org, Riku Voipio , qemu-devel@nongnu.org, Alexander Graf , Peter Crosthwaite , Max Filippov , "Vassili Karpov (malc)" , Paul Brook , Paolo Bonzini , Guan Xuetao , Aurelien Jarno , Richard Henderson 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 > wouldn't be useful to enable the flag for QEMU yet. > > Mark cases which don't have a comment about fall through with > a comment. In legitimate fall through cases the comment can be > edited later to mark the case for future readers. > > Signed-off-by: Blue Swirl > diff --git a/hw/ide/core.c b/hw/ide/core.c > index 14ad079..0457c65 100644 > --- a/hw/ide/core.c > +++ b/hw/ide/core.c > @@ -1151,6 +1151,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) > break; > case WIN_VERIFY_EXT: > lba48 = 1; > + /* XXX: questionable fallthrough */ > case WIN_VERIFY: > case WIN_VERIFY_ONCE: > /* do sector number check ? */ > @@ -1160,6 +1161,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) > break; > case WIN_READ_EXT: > lba48 = 1; > + /* XXX: questionable fallthrough */ > case WIN_READ: > case WIN_READ_ONCE: > if (s->drive_kind == IDE_CD) { > @@ -1175,6 +1177,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) > break; > case WIN_WRITE_EXT: > lba48 = 1; > + /* XXX: questionable fallthrough */ > case WIN_WRITE: > case WIN_WRITE_ONCE: > case CFA_WRITE_SECT_WO_ERASE: > @@ -1191,6 +1194,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) > break; > case WIN_MULTREAD_EXT: > lba48 = 1; > + /* XXX: questionable fallthrough */ > case WIN_MULTREAD: > if (!s->bs) { > goto abort_cmd; > @@ -1204,6 +1208,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) > break; > case WIN_MULTWRITE_EXT: > lba48 = 1; > + /* XXX: questionable fallthrough */ > case WIN_MULTWRITE: > case CFA_WRITE_MULTI_WO_ERASE: > if (!s->bs) { > @@ -1224,6 +1229,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) > break; > case WIN_READDMA_EXT: > lba48 = 1; > + /* XXX: questionable fallthrough */ > case WIN_READDMA: > case WIN_READDMA_ONCE: > if (!s->bs) { > @@ -1234,6 +1240,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) > break; > case WIN_WRITEDMA_EXT: > lba48 = 1; > + /* XXX: questionable fallthrough */ > case WIN_WRITEDMA: > case WIN_WRITEDMA_ONCE: > if (!s->bs) { > @@ -1245,6 +1252,7 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val) > break; > case WIN_READ_NATIVE_MAX_EXT: > lba48 = 1; > + /* XXX: questionable fallthrough */ > case WIN_READ_NATIVE_MAX: > ide_cmd_lba48_transform(s, lba48); > ide_set_sector(s, s->nb_sectors - 1); All IDE cases are clearly intentional. Kevin