client.c: In function ‘main’:
client.c:60:30: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
60 | printf("Send bytes: %d\n", sizeof(SendMsg));
| ~^ ~~~~~~~~~~~~~~~
| | |
| int long unsigned int
| %ld
-> %d를 %ld로 변경
client.c:62:13: error: ‘RecvMsg’ undeclared (first use in this function); did you mean ‘recvmsg’?
62 | if (RecvMsg.type == READ_REQ) type = "READ_REQ";
| ^~~~~~~
| recvmsg
client.c:62:13: note: each undeclared identifier is reported only once for each function it appears in
-> SendMsg로 변경
client.c:69:71: error: ‘sockaddr’ undeclared (first use in this function)
69 | sendto(sock, &SendMsg, sizeof(SendMsg), 0, (struct sockaddr*)&sockaddr, sizeof(sockaddr));
| ^~~~~~~~
-> src_addr로 변경
client.c:74:42: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
74 | printf("Received bytes: %d\n", sizeof(SendMsg));
| ~^ ~~~~~~~~~~~~~~~
| | |
| int long unsigned int
| %ld
-> %d를 %ld로 변경
make: *** [Makefile:7: client.o] Error 1
'코딩 > 해결' 카테고리의 다른 글
[분산시스템] [UDP 소켓 프로그래밍] server.c (0) | 2024.05.05 |
---|---|
[wsl] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? (0) | 2024.05.05 |