Skip to content

Commit 7b29828

Browse files
wdebruijkuba-moo
authored andcommitted
selftests/net: fix a char signedness issue
Signedness of char is signed on x86_64, but unsigned on arm64. Fix the warning building cmsg_sender.c on signed platforms or forced with -fsigned-char: msg_sender.c:455:12: error: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion] buf[0] = ICMPV6_ECHO_REQUEST; constant ICMPV6_ECHO_REQUEST is 128. Link: https://lwn.net/Articles/911914 Fixes: de17e30 ("selftests: net: cmsg_sender: support icmp and raw sockets") Signed-off-by: Willem de Bruijn <willemb@google.com> Link: https://lore.kernel.org/r/20231124171645.1011043-3-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0885598 commit 7b29828

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/net/cmsg_sender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ int main(int argc, char *argv[])
416416
{
417417
struct addrinfo hints, *ai;
418418
struct iovec iov[1];
419+
unsigned char *buf;
419420
struct msghdr msg;
420421
char cbuf[1024];
421-
char *buf;
422422
int err;
423423
int fd;
424424

0 commit comments

Comments
 (0)