diff mbox

bsd-user: Suppress gcc 4.x -Wpointer-sign (included in -Wall) warning

Message ID 1459867593-72017-1-git-send-email-emaste@freebsd.org
State New
Headers show

Commit Message

Ed Maste April 5, 2016, 2:46 p.m. UTC
This is the same change as b55266b5 in linux-user.

Signed-off-by: Ed Maste <emaste@freebsd.org>
---
 bsd-user/uaccess.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell April 5, 2016, 2:54 p.m. UTC | #1
On 5 April 2016 at 15:46, Ed Maste <emaste@freebsd.org> wrote:
> This is the same change as b55266b5 in linux-user.
>
> Signed-off-by: Ed Maste <emaste@freebsd.org>

Do you have many more of these bsd related patches to come?
It might be easier to deal with them all in one patchseries...

thanks
-- PMM
Ed Maste April 5, 2016, 3:26 p.m. UTC | #2
On 5 April 2016 at 10:54, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 5 April 2016 at 15:46, Ed Maste <emaste@freebsd.org> wrote:
>> This is the same change as b55266b5 in linux-user.
>>
>> Signed-off-by: Ed Maste <emaste@freebsd.org>
>
> Do you have many more of these bsd related patches to come?
> It might be easier to deal with them all in one patchseries...

I have nothing beyond these two. I caught the missing #include from a
build warning, but unfortunately didn't notice this (const char *)
difference vs linux-user when I mailed the first patch.

There are some warnings remaining in bsd-user still, but these should
be investigated after we sort out the bsd-user rework from Stacy Son
and Sean Bruno. I don't expect to have any further work until then.
Peter Maydell April 5, 2016, 5:13 p.m. UTC | #3
On 5 April 2016 at 15:46, Ed Maste <emaste@freebsd.org> wrote:
> This is the same change as b55266b5 in linux-user.
>
> Signed-off-by: Ed Maste <emaste@freebsd.org>
> ---
>  bsd-user/uaccess.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c
> index b7b3a06..91e2067 100644
> --- a/bsd-user/uaccess.c
> +++ b/bsd-user/uaccess.c
> @@ -51,7 +51,7 @@ abi_long target_strlen(abi_ulong guest_addr1)
>          ptr = lock_user(VERIFY_READ, guest_addr, max_len, 1);
>          if (!ptr)
>              return -TARGET_EFAULT;
> -        len = qemu_strnlen((char *)ptr, max_len);
> +        len = qemu_strnlen((const char *)ptr, max_len);
>          unlock_user(ptr, guest_addr, 0);
>          guest_addr += len;
>          /* we don't allow wrapping or integer overflow */
> --
> 2.4.6

Applied to master, thanks.

-- PMM
diff mbox

Patch

diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c
index b7b3a06..91e2067 100644
--- a/bsd-user/uaccess.c
+++ b/bsd-user/uaccess.c
@@ -51,7 +51,7 @@  abi_long target_strlen(abi_ulong guest_addr1)
         ptr = lock_user(VERIFY_READ, guest_addr, max_len, 1);
         if (!ptr)
             return -TARGET_EFAULT;
-        len = qemu_strnlen((char *)ptr, max_len);
+        len = qemu_strnlen((const char *)ptr, max_len);
         unlock_user(ptr, guest_addr, 0);
         guest_addr += len;
         /* we don't allow wrapping or integer overflow */