Bug 1368 - [LLVM] error: using the result of an assignment as a condition without parentheses
[LLVM] error: using the result of an assignment as a condition without paren...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: internet
ns-3-dev
All All
: P5 normal
Assigned To: George Riley
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-22 06:21 UTC by Gustavo J. A. M. Carneiro
Modified: 2012-02-23 18:30 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 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