Bugzilla – Bug 1367
[LLVM] error: using the result of an assignment as a condition without parentheses
Last modified: 2012-02-23 18:26:22 UTC
With clang++ (LLVM): [ 838/1334] cxx: src/internet/model/ipv6-interface.cc -> build/src/internet/model/ipv6-interface.cc.1.o 11:15:47 runner ['/usr/bin/clang++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-Wno-array-bounds', '-fPIC', '-pthread', '-Ibuild', '-I.', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DSQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DENABLE_GSL', '../src/internet/model/ipv6-interface.cc', '-c', '-o', 'src/internet/model/ipv6-interface.cc.1.o'] ../src/internet/model/ipv6-l3-protocol.cc:436: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/ipv6-l3-protocol.cc:436:18: note: use '==' to turn this assignment into an equality comparison if (device = DynamicCast<LoopbackNetDevice> (m_node->GetDevice (i))) ^ == ../src/internet/model/ipv6-l3-protocol.cc:436:18: note: place parentheses around the assignment to silence this warning if (device = DynamicCast<LoopbackNetDevice> (m_node->GetDevice (i))) ^ ( ) 1 error generated. It just needs extra parenthesis around the assignment.
Fixed, changeset 7739 - b521459d9d27