From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 63B223850848; Fri, 3 Jun 2022 14:09:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63B223850848 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] support: Suppress clang warning on tst-timespec X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 2a5d49699119ba191c1712d86605216e13fb6894 X-Git-Newrev: 8a01d858c5e08da6763ac08221347048e231e9ca Message-Id: <20220603140944.63B223850848@sourceware.org> Date: Fri, 3 Jun 2022 14:09:44 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2022 14:09:44 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8a01d858c5e08da6763ac08221347048e231e9ca commit 8a01d858c5e08da6763ac08221347048e231e9ca Author: Adhemerval Zanella Date: Fri Mar 25 11:26:46 2022 -0300 support: Suppress clang warning on tst-timespec clang warns that converting from TIME_T_MAX to double (upper_bound) loses precision (from 9223372036854775807 to 9223372036854775808). It does not matter in the test.A Checked on x86_64-linux-gnu. Diff: --- support/tst-timespec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/support/tst-timespec.c b/support/tst-timespec.c index 648a990e9c..b3cbb866ce 100644 --- a/support/tst-timespec.c +++ b/support/tst-timespec.c @@ -20,6 +20,7 @@ #include #include #include +#include #define TIMESPEC_HZ 1000000000 @@ -179,6 +180,11 @@ struct timespec_norm_test_case norm_cases[] = { } }; +/* clang warns that converting from TIME_T_MAX to double (upper_bound) + loses precision (from 9223372036854775807 to 9223372036854775808). + It does not matter in tests below. */ +DIAG_PUSH_NEEDS_COMMENT_CLANG; +DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wimplicit-const-int-float-conversion"); /* Test cases for timespec_check_in_range */ struct timespec_test_case check_cases[] = { /* 0 - In range */ @@ -290,6 +296,7 @@ struct timespec_test_case check_cases[] = { .upper_bound = TIME_T_MAX, .lower_bound = 1, .result = 1, }, }; +DIAG_POP_NEEDS_COMMENT_CLANG; static int do_test (void)