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

Re: [ns] ns-2 compiling



Hi Umberto-

These are simple problems caused by your compiler treating warnings as errors
(in other words, being more strict than the ones the developers are using).
You're probably safe casting them away as follows:

> c++ -c -O2 -I. -I/opt/EBBO/ns-allinone-2.1b6/tclcl-1.0b9 -I/opt/EBBO/ns-allinone-2.1b6/otcl-1.0a5 -I/opt/EBBO/ns-allinone-2.1b6/tkbox/include -I/opt/EBBO/ns-allinone-2.1b6/tclbox/include -o my-endian.o my-endian.cc
> my-endian.cc: In function `void ToOtherEndian(TEntry *)':
> my-endian.cc:42: conversion from `short unsigned int' to `enum method_t'
> my-endian.cc:45: conversion from `u_4bytes' to `enum method_t'
> my-endian.cc:48: conversion from `short unsigned int' to `enum protocol_t'
> my-endian.cc:51: conversion from `u_4bytes' to `enum protocol_t'
Add a (enum protocol_t) cast before the assignment, like
	e -> tail.method = (enum protocol_t)swap2(e -> tail.method);
and so on for lines 45,48,51. That should appease your compiler.

> utils.cc: In function `int saccept(int)':
> utils.cc:358: passing `int *' as argument 3 of `accept(int, sockaddr *, socklen_t *)' changes signedness
> utils.cc: In function `int sportnum(int)':
> utils.cc:469: passing `int *' as argument 3 of `getsockname(int, sockaddr *, socklen_t *)' changes signedness
This is the same kind of problem. Just add a (socklen_t *) in front of the 3rd
parameter on lines 358, 469. 

Hope that helps
-Eric

--------------------------------------------
 Eric H. Weigle   CCS-1, RADIANT team
 [email protected]     Los Alamos National Lab
 (505) 665-4937   http://home.lanl.gov/ehw/
--------------------------------------------