Nmap Development mailing list archives

[PATCH] Eliminate compiler warnings in scan_engine.cc


From: Daniel Roethlisberger <daniel () roe ch>
Date: Fri, 13 Feb 2009 15:01:19 +0100

The attached patch eliminates these (bogus) warnings by
initializing numprobes and portno respectively:

  scan_engine.cc: In member function 'unsigned int UltraScanInfo::numProbesPerHost()':
  scan_engine.cc:1560: warning: 'numprobes' may be used uninitialized in this function
  scan_engine.cc: In function 'bool ultrascan_port_pspec_update(UltraScanInfo*, HostScanStats*, const probespec*, int)':
  scan_engine.cc:2406: warning: 'portno' may be used uninitialized in this function

The warnings are due to GCC not recognizing that assert(0) never
returns.  It is not strictly necessary to initialize these two
vars, but I guess it can prevent errors creeping up in future
changes to that code.

-- 
Daniel Roethlisberger
http://daniel.roe.ch/

Attachment: gcc_warns_init.diff
Description:


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: