qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/3] fix clang negative signed bit shift warning


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 0/3] fix clang negative signed bit shift warning
Date: Mon, 16 Nov 2015 14:23:17 +0000

On 10 November 2015 at 15:57, Stefan Hajnoczi <address@hidden> wrote:
> LLVM's clang 3.7.0 compile warns about bit shifting negative numbers because
> the result is undefined.  This series includes 3 small fixes to appease clang.
>
> Stefan Hajnoczi (3):
>   monitor: avoid clang shifting negative signed warning
>   tpm: avoid clang shifting negative signed warning
>   disas/arm: avoid clang shifting negative signed warning
>
>  disas/arm.c           | 2 +-
>  hw/tpm/tpm_tis.c      | 2 +-
>  target-i386/monitor.c | 2 +-

My clang-3.7 build (it's part of fbinfer) also complains about:

/Users/pm215/src/qemu/hw/audio/fmopl.c:1085:39: warning: shifting a
negative signed value is undefined [-Wshift-negative-value]
                data = Limit( outd[0] , OPL_MAXOUT, OPL_MINOUT );
                                                    ^~~~~~~~~~
/Users/pm215/src/qemu/hw/audio/fmopl.c:75:28: note: expanded from
macro 'OPL_MINOUT'
#define OPL_MINOUT (-0x8000<<OPL_OUTSB)
                    ~~~~~~~^

and a lot of shift-of-negative uses in target-mips code.
Did you also have patches planned for those or are these three
the only ones you have in progress?

thanks
-- PMM



reply via email to

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