From d7f0aa3def1b7b66679f07e939a57ec26c428ceb Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Fri, 18 Mar 2022 15:20:33 +0100 Subject: [PATCH] =?UTF-8?q?send:=20Specify=20int=20as=20main()=E2=80=99s?= =?UTF-8?q?=20return=20type=20and=20include=20string.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the warnings below: $ make send cc send.c -o send send.c:41:1: warning: return type defaults to ‘int’ [-Wimplicit-int] main(int argc,char *argv[]) { ^~~~ send.c: In function ‘main’: send.c:63:5: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration] memset(buffer,0xA3,sizeof(buffer)); ^~~~~~ send.c:63:5: warning: incompatible implicit declaration of built-in function ‘memset’ send.c:63:5: note: include ‘’ or provide a declaration of ‘memset’ send.c:79:5: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration] memcpy(&sin.sin_addr,he->h_addr,he->h_length); ^~~~~~ send.c:79:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ send.c:79:5: note: include ‘’ or provide a declaration of ‘memcpy’ Reported-by: gcc (GCC) 7.5.0 --- send/send.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/send/send.c b/send/send.c index d7beef0..a6ee435 100644 --- a/send/send.c +++ b/send/send.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -38,7 +39,7 @@ void setLinger(int s) static char buffer[8192]; -main(int argc,char *argv[]) { +int main(int argc,char *argv[]) { char *host; short port;