Bug 1368

Summary: [LLVM] error: using the result of an assignment as a condition without parentheses
Product: ns-3 Reporter: Gustavo J. A. M. Carneiro <gjcarneiro>
Component: internetAssignee: George Riley <riley>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   

Description Gustavo J. A. M. Carneiro 2012-02-22 06:21:40 UTC
With clang++:

../src/internet/model/ipv4-l3-protocol.cc:236:18: error: using the result of an assignment as a condition without parentheses
      [-Werror,-Wparentheses]
      if (device = DynamicCast<LoopbackNetDevice> (m_node->GetDevice (i)))
          ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/internet/model/ipv4-l3-protocol.cc:236:18: note: use '==' to turn this assignment into an equality comparison
      if (device = DynamicCast<LoopbackNetDevice> (m_node->GetDevice (i)))
                 ^
                 ==
../src/internet/model/ipv4-l3-protocol.cc:236:18: note: place parentheses around the assignment to silence this warning
      if (device = DynamicCast<LoopbackNetDevice> (m_node->GetDevice (i)))
                 ^
          (                                                              )
Comment 1 Tommaso Pecorella 2012-02-23 18:30:55 UTC
Fixed, changeset 7741 - 2eec1176940e