[Ns-bugs] [Bug 486] Patches for compilation with icc

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Fri Feb 13 17:12:54 PST 2009


http://www.nsnam.org/bugzilla/show_bug.cgi?id=486


Anatoly Kamchatnov <akamch at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |akamch at gmail.com




--- Comment #11 from Anatoly Kamchatnov <akamch at gmail.com>  2009-02-13 20:12:54 EDT ---
(In reply to comment #3)

> > What warning are you fixing below ?
> 
> It's an error, which I cannot tell you why it occurs:
> 
> ../src/internet-stack/ipv4-l3-protocol.cc(1071): error: cast to type
> "ns3::Ipv4Address ()" is not allowed
>     if ((interface->GetAddress ()) != (Ipv4Address ())
>                                        ^
> ../src/internet-stack/ipv4-l3-protocol.cc(1072): error: expected an expression
>         && (interface->GetNetworkMask ()) != (Ipv4Mask ()))
>         ^

I stepped on this bug while compiling ns-3 with g++ 4.4 snapshot:

../src/internet-stack/ipv4-l3-protocol.cc: In member function ‘void
ns3::Ipv4L3Protocol::SetUp(uint32_t)’:
../src/internet-stack/ipv4-l3-protocol.cc:1072: error: expected identifier
before ‘(’ token
../src/internet-stack/ipv4-l3-protocol.cc:1072: warning: taking the address of
a label is non-standard
../src/internet-stack/ipv4-l3-protocol.cc:1072: error: expected ‘)’ before
‘(’ token

icc is more informative here; at least it tells us that it expects something to
be casted to Ipv4Mask() (how did it get that idea?). Adding another pair of
parentheses quieted the compiler:

--- ns-3-dev/src/internet-stack/ipv4-l3-protocol.cc     2009-02-14
03:53:06.000000000 +0300
+++ ns-3-rev/src/internet-stack/ipv4-l3-protocol.cc     2009-02-14
03:45:42.000000000 +0300
@@ -1068,7 +1068,7 @@
   // If interface address and network mask have been set, add a route
   // to the network of the interface (like e.g. ifconfig does on a
   // Linux box)
-  if ((interface->GetAddress ()) != (Ipv4Address ())
+  if (((interface->GetAddress ()) != (Ipv4Address ()))
       && (interface->GetNetworkMask ()) != (Ipv4Mask ()))
     {
       AddNetworkRouteTo (interface->GetAddress ().CombineMask
(interface->GetNetworkMask ()),


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Ns-bugs mailing list