[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
queue.h typo bug
My mailer couldn't deliver message to [email protected]
so I'm sending it to this list.
Hello ns developers.
I found some mistake in ns 2.1.b2
The compiler I use (SCO 5.0.4 C++/cc) complains about queue.h
file on line 75 :
inline Packet* tail() { return tail ? *tail_ : 0; }
Here is a compiler message:
"queue.h", line 75: error: address of bound function
(try using ``PacketQueue ::*'' for pointer type and ``&PacketQueue
::tail '' for address)
gcc 2.7.2.1 did not complain at all.
I think there is a simple typo mistake here. Instead
return tail ? should be
return tail_ ?
tail is an address of function tail() , and tail_ is a variable. The
function tail since it's declared/defined in class will always have
address != 0.
Here are some other messages worse attention:
1.
"ll.cc", line 109: error: argument 2 of type Handler* expected for
LinkDelay::recv()
"ll.cc", line 109: error: void operand for ?:
the line :
sendtarget_ ? sendto(p, h) : LinkDelay::recv(p);
should be:
sendtarget_ ? sendto(p, h) : LinkDelay::recv(p, h);
Am I wrong, or not?
2.
"srm.h", line 43: error: no value returned from SRMAgent::start()
Here start() is declared
virtual int start()
without return statement. I just inserted return 0;
Did not investigate the consequences yet.
With best regards. Ihor Strutynskyj.