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 <blauwir...@gmail.com>
> 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