본문 바로가기

코딩/해결

[분산시스템] [분산 key-value store 서버와 해쉬 함수 기반 파티션] client.c

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