diff --git a/nmap_error.h b/nmap_error.h index 080280dbd..8c588b6cb 100644 --- a/nmap_error.h +++ b/nmap_error.h @@ -121,11 +121,18 @@ extern "C" { #endif +#ifdef WIN32 +__declspec(noreturn) +#endif void fatal(const char *fmt, ...) __attribute__ ((noreturn)) __attribute__ ((format (printf, 1, 2))); void error(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); + +#ifdef WIN32 +__declspec(noreturn) +#endif void pfatal(const char *err, ...) __attribute__ ((noreturn)) __attribute__ ((format (printf, 1, 2))); diff --git a/tcpip.cc b/tcpip.cc index 3db10fa57..4f4750617 100644 --- a/tcpip.cc +++ b/tcpip.cc @@ -499,6 +499,9 @@ int send_ip_packet(int sd, struct eth_nfo *eth, u8 *packet, return send_ipv6_packet(sd, eth, packet, packetlen); fatal("%s only understands IP versions 4 and 6 (got %u)", __func__, ip->ip_v); + + /* This should not be reached. Just in case. */ + assert(0); } diff --git a/traceroute.cc b/traceroute.cc index 4f7b8fa81..b972828d7 100644 --- a/traceroute.cc +++ b/traceroute.cc @@ -724,6 +724,9 @@ public: } else { fatal("Unknown address family %u in %s.", source->ss_family, __func__); } + + /* This should not be reached. Just in case. */ + assert(0); } };