[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <06be2c94-730f-2c0c-e1ee-a4b72c8885eb@gmail.com>
Date: Fri, 24 Jul 2020 12:01:17 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Tanner Love <tannerlove.kernel@...il.com>, netdev@...r.kernel.org
Cc: davem@...emloft.net, Tanner Love <tannerlove@...gle.com>,
Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net] selftests/net: fix clang issues for target arch
PowerPC and others
On 7/24/20 11:17 AM, Tanner Love wrote:
> From: Tanner Love <tannerlove@...gle.com>
>
> Address these warnings observed with clang 9.
>
>
> tcp_mmap:
> Compilation yielded:
> warning: result of comparison of constant 34359738368 with \
> expression of type 'size_t' (aka 'unsigned int') is always true \
size_t is not generally 'unsigned int', not sure how you get this ?
> [-Wtautological-constant-out-of-range-compare]
> while (total < FILE_SZ) {
>
> Tested: make -C tools/testing/selftests TARGETS="net" run_tests
>
>
> diff --git a/tools/testing/selftests/net/tcp_mmap.c b/tools/testing/selftests/net/tcp_mmap.c
> index 4555f88252ba..92086d65bd87 100644
> --- a/tools/testing/selftests/net/tcp_mmap.c
> +++ b/tools/testing/selftests/net/tcp_mmap.c
> @@ -344,7 +344,7 @@ int main(int argc, char *argv[])
> {
> struct sockaddr_storage listenaddr, addr;
> unsigned int max_pacing_rate = 0;
> - size_t total = 0;
> + unsigned long total = 0;
> char *host = NULL;
> int fd, c, on = 1;
> char *buffer;
>
This will break on 32bit arches, where sizeof(unsigned long) == 4
Powered by blists - more mailing lists