mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Fix these compiler warnings with a patch from Solar Designer:
ncat_proxy.c: In function `ncat_http_server': ncat_proxy.c:163: warning: dereferencing type-punned pointer will break strict-aliasing rules nmap_dns.cc: In function `void parse_resolvdotconf()': nmap_dns.cc:951: warning: unsigned int format, different type arg (arg 4) traceroute.cc: In member function `void TracerouteState::read_replies(long int)': traceroute.cc:1031: warning: 'header_len' might be used uninitialized in this function
This commit is contained in:
@@ -947,7 +947,7 @@ static void parse_resolvdotconf() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Customize a sscanf format to sizeof(ipaddr). */
|
/* Customize a sscanf format to sizeof(ipaddr). */
|
||||||
Snprintf(fmt, sizeof(fmt), "nameserver %%%us", sizeof(ipaddr));
|
Snprintf(fmt, sizeof(fmt), "nameserver %%%us", (unsigned int) sizeof(ipaddr));
|
||||||
|
|
||||||
while (fgets(buf, sizeof(buf), fp)) {
|
while (fgets(buf, sizeof(buf), fp)) {
|
||||||
tp = buf;
|
tp = buf;
|
||||||
|
|||||||
@@ -122,10 +122,12 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void fatal(const char *fmt, ...)
|
void fatal(const char *fmt, ...)
|
||||||
|
__attribute__ ((noreturn))
|
||||||
__attribute__ ((format (printf, 1, 2)));
|
__attribute__ ((format (printf, 1, 2)));
|
||||||
void error(const char *fmt, ...)
|
void error(const char *fmt, ...)
|
||||||
__attribute__ ((format (printf, 1, 2)));
|
__attribute__ ((format (printf, 1, 2)));
|
||||||
void pfatal(const char *err, ...)
|
void pfatal(const char *err, ...)
|
||||||
|
__attribute__ ((noreturn))
|
||||||
__attribute__ ((format (printf, 1, 2)));
|
__attribute__ ((format (printf, 1, 2)));
|
||||||
void gh_perror(const char *err, ...)
|
void gh_perror(const char *err, ...)
|
||||||
__attribute__ ((format (printf, 1, 2)));
|
__attribute__ ((format (printf, 1, 2)));
|
||||||
|
|||||||
Reference in New Issue
Block a user