qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 2/2] linux-user/mmap: Fix Clang 'type-limit-compare' warn


From: Aleksandar Markovic
Subject: Re: [RFC PATCH 2/2] linux-user/mmap: Fix Clang 'type-limit-compare' warning
Date: Sun, 3 May 2020 21:04:03 +0200

> +#if TARGET_ABI_BITS < TARGET_LONG_BITS
>          /* Check if address fits target address space */
>          if ((unsigned long)host_addr + new_size > (abi_ulong)-1) {

It would be clearer if "#if  TARGET_LONG_BITS > TARGET_ABI_BITS"
is used, to match the comparison in if() statement.

>              /* Revert mremap() changes */
> @@ -721,6 +722,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong 
> old_size,
>              errno = ENOMEM;
>              host_addr = MAP_FAILED;
>          }
> +#endif /* TARGET_ABI_BITS < TARGET_LONG_BITS */
>      }
>
>      if (host_addr == MAP_FAILED) {
> --
> 2.21.3
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]