Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send: Specify int as main()’s return type and include string.h
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 ‘<string.h>’ 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 ‘<string.h>’ or provide a declaration of ‘memcpy’ Reported-by: gcc (GCC) 7.5.0
- Loading branch information