OSDN Git Service

linux-user: fix gcc-4.9 compiler error on __{get,put]}_user
authorRiku Voipio <riku.voipio@linaro.org>
Tue, 22 Apr 2014 12:40:50 +0000 (15:40 +0300)
committerRiku Voipio <riku.voipio@linaro.org>
Tue, 17 Jun 2014 05:52:08 +0000 (08:52 +0300)
commita42267ef58c4fcc9c9863f37dbe4cdbf887f8a7d
tree95d1db025e886902ce80b82afc5feac4cd86cf1e
parent9e918dc92723ee50a82d06296b3a14621d9eb52c
linux-user: fix gcc-4.9 compiler error on __{get,put]}_user

gcc-4.9 finds unused operand:

linux-user/syscall.c: In function ‘host_to_target_stat64’:
linux-user/qemu.h:301:19: error: right-hand operand of comma expression
has no effect [-Werror=unused-value]
      ((hptr), (x)), 0)

Just removing the rh operand is no good, it will error in later:

linux-user/main.c: In function ‘arm_kernel_cmpxchg64_helper’:
linux-user/qemu.h:330:15: error: void value not ignored as it ought to be
         __ret = __put_user((x), __hptr);    \

Thus, remove setting __ret from __get_user and __put_user, as and
set the right hand operand to (void)0 to make it clear that these
return never nothing.

This commit depends on the signal.c cleanup, to ensure bisectable
version history.

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Cc: Richard Henderson <rth@twiddle.net>
linux-user/qemu.h