qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC][MIPS][PATCH 3/6] Initial support of VIA IDE cont


From: Blue Swirl
Subject: Re: [Qemu-devel] [RFC][MIPS][PATCH 3/6] Initial support of VIA IDE controller used by fulong mini pc
Date: Tue, 11 May 2010 21:16:30 +0300

On 5/11/10, Markus Armbruster <address@hidden> wrote:
> Blue Swirl <address@hidden> writes:
>
>  > On 5/9/10, chen huacai <address@hidden> wrote:
>  >> This patch add initial support of VIA IDE controller used by fulong mini 
> pc
>  >>
>  >>  Signed-off-by: Huacai Chen <address@hidden>
>  >>  -----
>  [...]
>
> >>  diff --git a/hw/ide/via.c b/hw/ide/via.c
>  >>  new file mode 100644
>  >>  index 0000000..9adc5b5
>  >>  --- /dev/null
>  >>  +++ b/hw/ide/via.c
>  >>  @@ -0,0 +1,189 @@
>
> [...]
>
> >>  +static void bmdma_writeb(void *opaque, uint32_t addr, uint32_t val)
>  >>  +{
>  >>  +    BMDMAState *bm = opaque;
>  >>  +#ifdef DEBUG_IDE
>  >>  +    printf("bmdma: writeb 0x%02x : 0x%02x\n", addr, val);
>  >>  +#endif
>  >>  +    switch(addr & 3) {
>  >>  +    case 2:
>  >>  +        bm->status = (val & 0x60) | (bm->status & 1) | (bm->status &
>  >>  ~val & 0x06);
>  >>  +        break;
>  >
>  > Some gccs complain if there is no default case.
>
>
> Are you sure?  Which version?
>
>  It warns when the switch expression's type is an enumeration, and the
>  switch doesn't handle all enumeration constants, and has no default
>  case.
>
>  I can be made to warn whenever there's no default, but we don't do that.

This problem came up with 299b520cd4092be3c53f8380b81315c33927d9d3
(fixed before commit) and 4450521668471c7685551d8c5bcc582d754e9843,
with mingw gcc and OpenBSD gccs.

$ i586-mingw32msvc-gcc -v
Using built-in specs.
Target: i586-mingw32msvc
Configured with:
/home/ron/devel/debian/mingw32/mingw32-4.2.1.dfsg/build_dir/src/gcc-4.2.1-2-dfsg/configure
-v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++
--enable-threads --enable-sjlj-exceptions --disable-multilib
--enable-version-specific-runtime-libs
Thread model: win32
gcc version 4.2.1-sjlj (mingw32-2)

$ gcc -v
Reading specs from /usr/lib/gcc-lib/sparc64-unknown-openbsd4.6/3.3.5/specs
Configured with:
Thread model: single
gcc version 3.3.5 (propolice)

Maybe those cases were different from this.

>
>  A quick grep finds roughly 600 switches without default case in our
>  code.
>
>  >>  +    }
>  >>  +}
>  [...]
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]