On 27.10.20 19:39, Andrea Bastoni wrote: > On 27/10/2020 13:36, Jan Kiszka wrote: >> On 22.10.20 19:58, Andrea Bastoni wrote: >>> This solves warnings due to -Wbuiltin-declaration-mismatch >>> >>> Signed-off-by: Andrea Bastoni <[email protected]> >>> --- >>> hypervisor/include/jailhouse/string.h | 5 +++-- >>> hypervisor/include/jailhouse/types.h | 8 ++++++++ >>> hypervisor/lib.c | 6 +++--- >>> 3 files changed, 14 insertions(+), 5 deletions(-) >>> >>> diff --git a/hypervisor/include/jailhouse/string.h >>> b/hypervisor/include/jailhouse/string.h >>> index 24f0b0b4..7dc3de3b 100644 >>> --- a/hypervisor/include/jailhouse/string.h >>> +++ b/hypervisor/include/jailhouse/string.h >>> @@ -12,9 +12,10 @@ >>> * This work is licensed under the terms of the GNU GPL, version 2. See >>> * the COPYING file in the top-level directory. >>> */ >>> +#include <jailhouse/types.h> >>> >>> -void *memcpy(void *d, const void *s, unsigned long n); >>> -void *memset(void *s, int c, unsigned long n); >>> +void *memcpy(void *d, const void *s, size_t n); >>> +void *memset(void *s, int c, size_t n); >>> >>> int strcmp(const char *s1, const char *s2); >>> >>> diff --git a/hypervisor/include/jailhouse/types.h >>> b/hypervisor/include/jailhouse/types.h >>> index 828e40f7..f97dc252 100644 >>> --- a/hypervisor/include/jailhouse/types.h >>> +++ b/hypervisor/include/jailhouse/types.h >>> @@ -55,6 +55,14 @@ typedef u32 __u32; >>> typedef s64 __s64; >>> typedef u64 __u64; >>> >>> +#if BITS_PER_LONG == 64 >>> +typedef unsigned long uptr_t; >>> +#else >>> +typedef unsigned int uptr_t; >>> +#endif >>> + >>> +typedef uptr_t size_t; >> >> What's the benefit of the indirection via uptr_t? > > Since I was adding a size dependent type, I thought to add an equivalent to > uintptr_t which could be used in other contexts. Probably I should have called > it uintptr_t directly.
If you find use cases for that time in the code, please go ahead in refactor. But we do not build a universal library with the hypervisor. So rather define size_t directly if there is no user (yet). Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jailhouse-dev/c51882a5-1bd5-3bb3-58e3-3eab6171ad43%40siemens.com.
