Differences warnings in standard commands compile gcc and clang

 

warnings on gcc

gcc TCP-Syn-port-scanner.c -o TCP-Syn-port-scanner
/tmp/ccFPV136.o: In function `main’:
TCP-Syn-port-scanner.c:(.text+0x3b9): undefined reference to `pthread_create’
TCP-Syn-port-scanner.c:(.text+0x540): undefined reference to `pthread_join’
collect2: error: ld returned 1 exit status

warnings on clang

$clang TCP-Syn-port-scanner.c -o TCP-Syn-port-scanner
TCP-Syn-port-scanner.c:189:5: warning: implicit declaration of function ‘start_sniffer’ is invalid in C99 [-Wimplicit-function-declaration]
start_sniffer();
^
TCP-Syn-port-scanner.c:190:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
TCP-Syn-port-scanner.c:219:71: warning: passing ‘int *’ to parameter of type ‘socklen_t *’ (aka ‘unsigned int *’) converts between pointers to integer types with different sign [-Wpointer-sign]
data_size = recvfrom(sock_raw , buffer , 65536 , 0 , &saddr , &saddr_size);
^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/sys/socket.h:168:27: note: passing argument to parameter ‘__addr_len’ here
socklen_t *__restrict __addr_len);
^
TCP-Syn-port-scanner.c:232:5: warning: implicit declaration of function ‘close’ is invalid in C99 [-Wimplicit-function-declaration]
close(sock_raw);
^
TCP-Syn-port-scanner.c:347:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
5 warnings generated.
/tmp/TCP-Syn-port-scanner-stjuCw.o: In function `main’:
TCP-Syn-port-scanner.c:(.text+0x4c4): undefined reference to `pthread_create’
TCP-Syn-port-scanner.c:(.text+0x6b6): undefined reference to `pthread_join’
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@firebitsbr

Anúncios

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s