Skip to contentSkip to conversation

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

PATCH Applied Ed Maste 2 participants 4 messages Apr 5, 2016

lore
Share & tools
lore

Ed Maste

author
#0 lore raw

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

This is the same change as b55266b5 in linux-user.

---
 bsd-user/uaccess.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bsd-user/uaccess.c +1 -1
index b7b3a06..91e2067 100644
@@ -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 */
Signature · 1 line
2.4.6
#1 lore raw
Quoted 3 lines · Ed Maste

This is the same change as b55266b5 in linux-user.

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

author
#2 lore raw
Quoted 7 lines · Peter Maydell
Quoted 3 lines · Ed Maste

This is the same change as b55266b5 in linux-user.

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.

#3 lore raw
In reply to Ed Maste
Quoted 21 lines · Ed Maste

This is the same change as b55266b5 in linux-user.

---
 bsd-user/uaccess.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bsd-user/uaccess.c +1 -2
index b7b3a06..91e2067 100644
@@ -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 */
--
Quoted 1 line

2.4.6

Applied to master, thanks.

-- PMM