clang claims: variable 'port' is used uninitialized whenever switch default
is taken. And that is a lie, but error() is not marked as function that
never returns, because it can also be used when printing warning. So the
compiler is guessing wrong, but the easiest fix is to initialize the
variable rather than educate compiler.
static void net_send_tcp(int index)
{
int ttl, s;
- int port;
+ int port = 0;
int flags;
struct sockaddr_storage local;
struct sockaddr_storage remote;
{
int ttl, s;
int opt = 1;
- int port;
+ int port = 0;
struct sockaddr_storage local;
struct sockaddr_storage remote;
struct sockaddr_in *local4 = (struct sockaddr_in *) &local;