aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-24 16:03:16 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-02-09 10:29:18 -0300
commit53e0080c7c48cc00a132e40652f5f6e7a3efba51 (patch)
treea5a0fa9c37f2c9189081bdfdd7f0ddc0172097f0
parent26815d21b8a4775ea6123f6197caa04bae4c4595 (diff)
downloadglibc-53e0080c7c48cc00a132e40652f5f6e7a3efba51.tar
glibc-53e0080c7c48cc00a132e40652f5f6e7a3efba51.tar.gz
glibc-53e0080c7c48cc00a132e40652f5f6e7a3efba51.tar.bz2
glibc-53e0080c7c48cc00a132e40652f5f6e7a3efba51.zip
stdio: Suppress clang warnings for tst-unlockedio.c
Clang issues the following warnings: tst-unlockedio.c:63:36: error: implicit conversion from 'double' to 'size_t' (aka 'unsigned long') changes value from -0 to 0 [-Werror,-Wliteral-conversion] || fwrite_unlocked (blah, 0, -0.0, fp) != 0 ~~~~~~~~~~~~~~~ ^~~~ tst-unlockedio.c:61:33: error: implicit conversion from 'double' to 'size_t' (aka 'unsigned long') changes value from 0.25 to 0 [-Werror,-Wliteral-conversion] || fwrite_unlocked (--cp, 0.25, 16, fp) != 0 ~~~~~~~~~~~~~~~ ^~~~ tst-unlockedio.c:59:37: error: implicit conversion from 'double' to 'size_t' (aka 'unsigned long') changes value from 0.25 to 0 [-Werror,-Wliteral-conversion] || fwrite_unlocked (cp++, 16, 0.25, fp) != 0 ~~~~~~~~~~~~~~~ ^~~~ tst-unlockedio.c:116:34: error: implicit conversion from 'double' to 'size_t' (aka 'unsigned long') changes value from -0 to 0 [-Werror,-Wliteral-conversion] || fread_unlocked (buf, 0, -0.0, fp) != 0 ~~~~~~~~~~~~~~ ^~~~ tst-unlockedio.c:114:32: error: implicit conversion from 'double' to 'size_t' (aka 'unsigned long') changes value from 0.25 to 0 [-Werror,-Wliteral-conversion] || fread_unlocked (--wp, 0.25, 16, fp) != 0 ~~~~~~~~~~~~~~ ^~~~ tst-unlockedio.c:112:36: error: implicit conversion from 'double' to 'size_t' (aka 'unsigned long') changes value from 0.25 to 0 [-Werror,-Wliteral-conversion] || fread_unlocked (wp++, 16, 0.25, fp) != 0 ~~~~~~~~~~~~~~ ^~~~
-rw-r--r--stdio-common/tst-unlockedio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stdio-common/tst-unlockedio.c b/stdio-common/tst-unlockedio.c
index 8ff6b074b0..d0ebbbfc94 100644
--- a/stdio-common/tst-unlockedio.c
+++ b/stdio-common/tst-unlockedio.c
@@ -51,6 +51,9 @@ do_test (void)
fread_unlocked below as well. */
DIAG_PUSH_NEEDS_COMMENT;
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdiv-by-zero");
+ /* clang warns about the implicit conversion from double to size_t,
+ which is required by this tests. */
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wliteral-conversion");
if (ftello (fp) != 0
|| fwrite_unlocked (blah, blah - blah, strlen (blah), f++) != 0
|| f != fp + 1
@@ -104,6 +107,7 @@ do_test (void)
/* See explanation above. */
DIAG_PUSH_NEEDS_COMMENT;
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdiv-by-zero");
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wliteral-conversion");
if (ftello (fp) != 0
|| fread_unlocked (buf, buf - buf, strlen (blah), f++) != 0
|| f != fp + 1