From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 098A3396E058; Fri, 13 May 2022 14:23:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 098A3396E058 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: a9c727229112d9a6c393be641746a0b4872d5ffd X-Git-Newrev: c8ee4cf0c90d6011a6d39fe56aa98268486bf6a8 Message-Id: <20220513142335.098A3396E058@sourceware.org> Date: Fri, 13 May 2022 14:23:35 +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, 13 May 2022 14:23:35 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c8ee4cf0c90d6011a6d39fe56aa98268486bf6a8 commit c8ee4cf0c90d6011a6d39fe56aa98268486bf6a8 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)