Bugzilla – Bug 1372
[LLVM] error: using the result of an assignment as a condition without parentheses
Last modified: 2012-03-12 07:33:32 UTC
[ 931/1334] cxx: src/applications/model/udp-echo-client.cc -> build/src/applications/model/udp-echo-client.cc.1.o ../src/applications/model/udp-echo-client.cc:331:17: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses] while (packet = socket->RecvFrom (from)) ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ../src/applications/model/udp-echo-client.cc:331:17: note: use '==' to turn this assignment into an equality comparison while (packet = socket->RecvFrom (from)) ^ == ../src/applications/model/udp-echo-client.cc:331:17: note: place parentheses around the assignment to silence this warning while (packet = socket->RecvFrom (from)) ^ ( ) 1 error generated.
More of the same: ../src/applications/model/ping6.cc:234:17: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses] while (packet = socket->RecvFrom (from)) ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ../src/applications/model/ping6.cc:234:17: note: use '==' to turn this assignment into an equality comparison while (packet = socket->RecvFrom (from)) ^ == ../src/applications/model/ping6.cc:234:17: note: place parentheses around the assignment to silence this warning while (packet = socket->RecvFrom (from)) ^ ( ) 1 error generated. and: ../src/applications/model/packet-sink.cc:171:17: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses] while (packet = socket->RecvFrom (from)) ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ../src/applications/model/packet-sink.cc:171:17: note: use '==' to turn this assignment into an equality comparison while (packet = socket->RecvFrom (from)) ^ == ../src/applications/model/packet-sink.cc:171:17: note: place parentheses around the assignment to silence this warning while (packet = socket->RecvFrom (from)) ^ ( ) 1 error generated.
../src/applications/model/radvd.cc:238:17: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses] while (packet = socket->RecvFrom (from)) ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ../src/applications/model/radvd.cc:238:17: note: use '==' to turn this assignment into an equality comparison while (packet = socket->RecvFrom (from)) ^ == ../src/applications/model/radvd.cc:238:17: note: place parentheses around the assignment to silence this warning while (packet = socket->RecvFrom (from)) ^ ( ) 1 error generated.
../src/applications/model/udp-server.cc:155:17: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses] while (packet = socket->RecvFrom (from)) ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ../src/applications/model/udp-server.cc:155:17: note: use '==' to turn this assignment into an equality comparison while (packet = socket->RecvFrom (from)) ^ == ../src/applications/model/udp-server.cc:155:17: note: place parentheses around the assignment to silence this warning while (packet = socket->RecvFrom (from)) ^ ( ) 1 error generated. ../src/applications/model/udp-echo-server.cc:146:17: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses] while (packet = socket->RecvFrom (from)) ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ ../src/applications/model/udp-echo-server.cc:146:17: note: use '==' to turn this assignment into an equality comparison while (packet = socket->RecvFrom (from)) ^ == ../src/applications/model/udp-echo-server.cc:146:17: note: place parentheses around the assignment to silence this warning while (packet = socket->RecvFrom (from)) ^ ( ) 1 error generated.
Created attachment 1336 [details] patch to add parenthesis
The patch worked for me :)
Path applied mercurial changeset: 7760:e98d9c028d7f