[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Warnings in Solaris compile



For the benefit of future efforts to eliminate minor annoyances (which
may warn of bona fide bugs not yet discovered), here are the warnings I
obtained when compiling ns-2.1b5 (from the ns-allinone-2.1b5a
distribution) on a Solaris machine (SunOS 5.6).  I am posting this to
the list because

1) I suspect that these would be easy to fix for the next release by
someone knowledgeable in the particular files (I certainly am not); and
2) some of these warnings may be potentially serious (see, in
particular, warnings numbered 2 and 17, below).

So, here are the warnings: 

1) 'make depend' yields an error message regarding IP_BROADCAST being
redefined:
	In file included from emulate/nat.cc:50:
	ip.h:47: warning: `IP_BROADCAST' redefined
	/usr/include/netinet/in.h:275: warning: this is the location of
		the previous definition

The rest of these warnings were obtained during 'make' following 
'make depend':

2) rng.cc
rng.cc: In method `int RNG::command(int, const char *const *)':
rng.cc:231: warning: decimal integer constant is so large that it is
	unsigned
rng.cc: In method `RNGTest::RNGTest()':
rng.cc:350: warning: `long int r' might be used uninitialized in this
	function

3) classifier-mac.cc
classifier-mac.cc: In method `void MacClassifier::recv(class Packet *,
	class Handler *)':
classifier-mac.cc:66: warning: `class Mac * mac' might be used
	uninitialized in this function
classifier-mac.cc:73: warning: `class Mac * this' might be used
	uninitialized in this function
classifier-mac.cc:78: warning: `class Mac * this' might be used
	uninitialized in this function

4) traffictrace.cc
traffictrace.cc: In method `int TraceFile::setup()':
traffictrace.cc:150: warning: comparison between signed and unsigned

5) sa.cc
sa.cc: In method `void SA_Agent::sendmsg(int, const char * = 0)':
sa.cc:253: warning: `int n' might be used uninitialized in this function

6) agent.cc
agent.cc: In method `Agent::~Agent()':
agent.cc:134: warning: `struct OldValue * p' might be used uninitialized
	in this function

7) udp.cc
udp.cc: In method `void UdpAgent::sendmsg(int, const char * = 0)':
udp.cc:52: warning: `int n' might be used uninitialized in this function

8) rtp.cc
rtp.cc: In method `void RTPAgent::sendmsg(int, const char * = 0)':
rtp.cc:93: warning: `int n' might be used uninitialized in this function

9) tcp-sink.cc
tcp-sink.cc: In method `void TcpSink::ack(class Packet *)':
tcp-sink.cc:144: warning: `struct hdr_flags * sf' might be used
	uninitialized in this function
tcp-sink.cc:165: warning: `struct hdr_flags * this' might be used
	uninitialized in this function
tcp-sink.cc:169: warning: `struct hdr_flags * this' might be used
	uninitialized in this function
tcp-sink.cc:169: warning: `struct hdr_flags * this' might be used
	uninitialized in this function
tcp-sink.cc:172: warning: `struct hdr_flags * this' might be used
	uninitialized in this function
tcp-sink.cc:176: warning: `struct hdr_flags * this' might be used
	uninitialized in this function
tcp-sink.cc:176: warning: `struct hdr_flags * this' might be used
	uninitialized in this function

10) tcp-newreno.cc
tcp-newreno.cc: In method `void NewRenoTcpAgent::partialnewack(class Packet *)':
tcp-newreno.cc:70: warning: `unsigned int deflate' might be used 
	uninitialized in this function

11) tcp-session.cc
tcp-session.cc: In method `class IntTcpAgent *TcpSessionAgent::who_to_snd(int)':
tcp-session.cc:393: warning: `int maxConsecSegs' might be used
	uninitialized in this function

12) fq.cc
fq.cc: In method `class Packet * FQ::deque()':
fq.cc:135: warning: `double best' might be used uninitialized in this
	function

13) srm-topo.cc
srm-topo.cc: In method `double Line::backoff(int)':
srm-topo.cc:89: warning: `double b' might be used uninitialized in this
	function
srm-topo.cc: In method `double BTree::backoff(int)':
srm-topo.cc:229: warning: `double b' might be used uninitialized in this
	function

14) dem.cc
dem.cc: In method `void DEMFile::read_field()':
dem.cc:73: warning: `char ch' might be used uninitialized in this
	function

15) wireless-phy.cc
wireless-phy.cc: In method `int WirelessPhy::sendUp(class Packet *)':
wireless-phy.cc:162: warning: `double Pr' might be used uninitialized in
	this function

16) cmu-trace.cc
cmu-trace.cc: In method `void CMUTrace::recv(class Packet *, class 
	Handler *)':
cmu-trace.cc:291: warning: unused variable `struct hdr_ip * ih'

17) dsdv/dsdv.cc
dsdv/dsdv.cc: In method `void DSDV_Agent::updateRoute(class rtable_ent 
*, class rtable_ent *)':
dsdv/dsdv.cc:548: warning: converting of negative value `-1' to
	`unsigned int'
dsdv/dsdv.cc:549: warning: converting of negative value `-1' to
	`unsigned int'

18) dsr/dsragent.cc
dsr/dsragent.cc: In method `void DSRAgent::handlePktWithoutSR(struct
	SRPacket &,bool)':
dsr/dsragent.cc:537: warning: unused variable `struct hdr_sr * srh'

--dan

---------------------------------------------------------------------------
 Daniel Friedman    [email protected]    http://www.isr.umd.edu/~danielf