On 17.12.2017 11:58, Stefan Weil wrote:
> Am 17.12.2017 um 11:25 schrieb no-re...@patchew.org:
>> Hi,
>>
>> This series failed build test on s390x host. Please find the details below.
> [...]
>> /var/tmp/patchew-tester-tmp-e2qiwzsb/src/target/s390x/interrupt.c: In 
>> function ‘s390_program_interrupt’:
>> /var/tmp/patchew-tester-tmp-e2qiwzsb/src/target/s390x/interrupt.c:55:1: 
>> error: ‘noreturn’ function does return [-Werror]
> 
> Obviously the s390x compiler does more checks than my x86 gcc.
> 
> To fix the new warning, QEMU_NORETURN would have to be added to
> kvm_s390_program_interrupt and tcg_s390_program_interrupt, too.
> 
> I am not sure about kvm_s390_program_interrupt. Is it a function which
> will never return? Then the current code (which includes a return
> statement in kvm_s390_vcpu_interrupt) is not correct.

kvm_s390_program_interrupt() returns, so adding a QEMU_NORETURN to that
function is not a good idea.

> We could also move the g_assert_not_reached in s390_program_interrupt to
> the end of the function. That should satisfy the compiler as well.

That also does not work since kvm_s390_program_interrupt() returns.

> Or we could suppress the s390x compiler warning by using a compiler
> pragma. But I don't like that alternative.

I think the best solution would be to call tcg_s390_program_interrupt()
directly from helper_divs64() instead of going through the
s390_program_interrupt() wrapper. helper_divs64() is for TCG only, so it
should be fine to directly use the tcg_s390_program_interrupt() function
there.

 Thomas

Reply via email to