Re: [Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile

2014-07-01 Thread Paolo Bonzini
Il 01/07/2014 10:19, Peter Maydell ha scritto: > I think something like "double x; int f(void) {return isnan(sin(x));}" > should be bullet proof. This is a compile_prog test, though -- the compiler could spot that x and f are both unused, since it has the entire program in hand. My suggestion wo

Re: [Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile

2014-07-01 Thread Peter Maydell
On 1 July 2014 07:52, Paolo Bonzini wrote: > Il 01/07/2014 07:42, Alexey Kardashevskiy ha scritto: > >> This is wrong actually. The problem here that compiler knows how to >> optimize constants. sin(0.0) is the one while log(0.0) is not (it is >> supposed to throw error or something as it the resu

Re: [Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile

2014-06-30 Thread Paolo Bonzini
Il 01/07/2014 07:42, Alexey Kardashevskiy ha scritto: This is wrong actually. The problem here that compiler knows how to optimize constants. sin(0.0) is the one while log(0.0) is not (it is supposed to throw error or something as it the result is infinity). So the correct test here could be: in

Re: [Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile

2014-06-30 Thread Alexey Kardashevskiy
On 07/01/2014 11:51 AM, Alexey Kardashevskiy wrote: > The existing test whether "-lm" needs to be included or not is > insufficient as it reports false negative on Fedora20/ppc64. > As the result, qemu-nbd/qemu-io/qemu-img tools cannot compile. > > This replaces sin() with log() in the test. > >

[Qemu-devel] [PATCH fix for 2.1] makefile: Fix tools compile

2014-06-30 Thread Alexey Kardashevskiy
The existing test whether "-lm" needs to be included or not is insufficient as it reports false negative on Fedora20/ppc64. As the result, qemu-nbd/qemu-io/qemu-img tools cannot compile. This replaces sin() with log() in the test. Signed-off-by: Alexey Kardashevskiy --- The bug was triggered b