aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-12-17 05:54:52 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-18 01:25:55 +0800
commit4666f5c3eebd95e3e39dfb7923aa74c28db4fb8a (patch)
tree1b89473e29773af62c64c59b3b6880dbf286dd7b
parent0cc88d232757d4cbd771fed695d30af79674eb45 (diff)
downloadglibc-4666f5c3eebd95e3e39dfb7923aa74c28db4fb8a.zip
glibc-4666f5c3eebd95e3e39dfb7923aa74c28db4fb8a.tar.gz
glibc-4666f5c3eebd95e3e39dfb7923aa74c28db4fb8a.tar.bz2
tst-resolv-invalid-cname.c: Explicitly cast 192 and 168 to char
Explicitly cast 192 and 168 to char to silence Clang error: tst-resolv-invalid-cname.c:313:17: error: implicit conversion from 'int' to 'char' changes value from 192 to -64 [-Werror,-Wconstant-conversion] 313 | addr[0] = 192; | ~ ^~~ tst-resolv-invalid-cname.c:314:17: error: implicit conversion from 'int' to 'char' changes value from 168 to -88 [-Werror,-Wconstant-conversion] 314 | addr[1] = 168; | ~ ^~~ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
-rw-r--r--resolv/tst-resolv-invalid-cname.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/resolv/tst-resolv-invalid-cname.c b/resolv/tst-resolv-invalid-cname.c
index 69f1c63..15ee9cb 100644
--- a/resolv/tst-resolv-invalid-cname.c
+++ b/resolv/tst-resolv-invalid-cname.c
@@ -310,8 +310,8 @@ check_reverse (int af, int bits, int count)
socklen_t addrlen;
if (af == AF_INET)
{
- addr[0] = 192;
- addr[1] = 168;
+ addr[0] = (char) 192;
+ addr[1] = (char) 168;
addr[2] = count;
addr[3] = bits;
addrlen = 4;