Bug 317 - build error
build error
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
ns-3-dev
PC Windows
: P1 critical
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-06 06:47 UTC by Gavin Weng
Modified: 2008-09-08 14:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Weng 2008-09-06 06:47:24 UTC
[335/519] cxx: src/internet-stack/nsc-tcp-socket-impl.cc -> build/debug/src/inte
rnet-stack/nsc-tcp-socket-impl_1.o
../src/internet-stack/nsc-tcp-socket-impl.cc: In member function `virtual int ns
3::NscTcpSocketImpl::Send(ns3::Ptr<ns3::Packet>, uint32_t)':
../src/internet-stack/nsc-tcp-socket-impl.cc:347: warning: converting of negativ
e value `-0x000000001' to `long unsigned int'
Build failed
 -> task failed (err #129): [bld:///cygdrive/d/NS-3/repos/ns-3-dev/src/internet-
stack/nsc-tcp-socket-impl_1.o]
Comment 1 Gustavo J. A. M. Carneiro 2008-09-06 10:46:29 UTC
In mingw more problems occur.  Maybe it's better to not compile nsc code unconditionally after all?


[329/529] cxx: src\internet-stack\nsc-tcp-socket-impl.cc -> build\debug\src\inte
rnet-stack\nsc-tcp-socket-impl_1.o
..\src\internet-stack\nsc-tcp-socket-impl.cc:36:24: sys/socket.h: No such file o
r directory
..\src\internet-stack\nsc-tcp-socket-impl.cc:37:24: netinet/in.h: No such file o
r directory
..\src\internet-stack\nsc-tcp-socket-impl.cc:38:23: arpa/inet.h: No such file or
 directory
..\src\internet-stack\nsc-tcp-socket-impl.cc:39:24: netinet/ip.h: No such file o
r directory
..\src\internet-stack\nsc-tcp-socket-impl.cc:40:25: netinet/tcp.h: No such file
or directory
..\src\internet-stack\nsc-tcp-socket-impl.cc: In member function `virtual int ns
3::NscTcpSocketImpl::Connect(const ns3::Address&)':
..\src\internet-stack\nsc-tcp-socket-impl.cc:310: error: aggregate `ns3::in_addr
 remoteAddr' has incomplete type and cannot be defined
..\src\internet-stack\nsc-tcp-socket-impl.cc:316: error: `inet_ntoa' was not dec
lared in this scope
..\src\internet-stack\nsc-tcp-socket-impl.cc:316: warning: unused variable 'inet
_ntoa'
..\src\internet-stack\nsc-tcp-socket-impl.cc: In member function `virtual int ns
3::NscTcpSocketImpl::Send(ns3::Ptr<ns3::Packet>, uint32_t)':
..\src\internet-stack\nsc-tcp-socket-impl.cc:347: warning: converting of negativ
e value `-0x000000001' to `unsigned int'
..\src\internet-stack\nsc-tcp-socket-impl.cc: In member function `void ns3::NscT
cpSocketImpl::CompleteFork()':
..\src\internet-stack\nsc-tcp-socket-impl.cc:500: error: `ntohs' was not declare
d in this scope
..\src\internet-stack\nsc-tcp-socket-impl.cc:500: warning: unused variable 'ntoh
s'
..\src\internet-stack\nsc-tcp-socket-impl.cc: In member function `void ns3::NscT
cpSocketImpl::ConnectionSucceeded()':
..\src\internet-stack\nsc-tcp-socket-impl.cc:535: error: `ntohs' was not declare
d in this scope
..\src\internet-stack\nsc-tcp-socket-impl.cc:535: warning: unused variable 'ntoh
s'
Build failed
 -> task failed (err #129): [bld://P:\ns\ns-3-dev\src\internet-stack\nsc-tcp-soc
ket-impl_1.o]
Comment 2 Florian Westphal 2008-09-06 13:26:33 UTC
I doubt NSC itself works on mingw (or cygwin, for that matter), so
I think we need to blacklist those two.
Regarding the
src/internet-stack/nsc-tcp-socket-impl.cc:347: warning: converting of
error: That looks like a compiler bug to me, why would it need to convert
to an unsigned type here?

return txEmpty ? p->GetSize () : -1;

The method returns int.
Does
return txEmpty ? (int) p->GetSize () : -1;

make things work?
Comment 3 Mathieu Lacage 2008-09-06 14:37:16 UTC
(In reply to comment #2)
> I doubt NSC itself works on mingw (or cygwin, for that matter), so
> I think we need to blacklist those two.

I am fairly certain that sam made sure that nsc would work on cygwin so disabling it on these platforms would require at least a serious understanding of the problem and being convinced that we can't fix the problems.

> Regarding the
> src/internet-stack/nsc-tcp-socket-impl.cc:347: warning: converting of
> error: That looks like a compiler bug to me, why would it need to convert
> to an unsigned type here?
> 
> return txEmpty ? p->GetSize () : -1;

I don't know about the code or the error but Packet::GetSize returns an unsigned integer so, the (int) below is probably right.

> 
> The method returns int.
> Does
> return txEmpty ? (int) p->GetSize () : -1;
> 
> make things work?
> 

Comment 4 Gustavo J. A. M. Carneiro 2008-09-07 10:04:42 UTC
(In reply to comment #0)
> [335/519] cxx: src/internet-stack/nsc-tcp-socket-impl.cc ->
> build/debug/src/inte
> rnet-stack/nsc-tcp-socket-impl_1.o
> ../src/internet-stack/nsc-tcp-socket-impl.cc: In member function `virtual int
> ns
> 3::NscTcpSocketImpl::Send(ns3::Ptr<ns3::Packet>, uint32_t)':
> ../src/internet-stack/nsc-tcp-socket-impl.cc:347: warning: converting of
> negativ
> e value `-0x000000001' to `long unsigned int'
> Build failed
>  -> task failed (err #129):
> [bld:///cygdrive/d/NS-3/repos/ns-3-dev/src/internet-
> stack/nsc-tcp-socket-impl_1.o]
> 

I posted a patch to fix this in bug #316.
Comment 5 Mathieu Lacage 2008-09-08 14:29:07 UTC
this bug is fixed now.