Bug 1372 - [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 parent...
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: applications
ns-3-dev
All All
: P5 normal
Assigned To: George Riley
:
Depends on:
Blocks: 1345
  Show dependency treegraph
 
Reported: 2012-02-22 06:30 UTC by Gustavo J. A. M. Carneiro
Modified: 2012-03-12 07:33 UTC (History)
2 users (show)

See Also:


Attachments
patch to add parenthesis (2.60 KB, patch)
2012-02-22 06:39 UTC, Gustavo J. A. M. Carneiro
Details | Diff

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:30:52 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.
Comment 1 Gustavo J. A. M. Carneiro 2012-02-22 06:34:55 UTC
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.
Comment 2 Gustavo J. A. M. Carneiro 2012-02-22 06:36:00 UTC
../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.
Comment 3 Gustavo J. A. M. Carneiro 2012-02-22 06:37:36 UTC
../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.
Comment 4 Gustavo J. A. M. Carneiro 2012-02-22 06:39:25 UTC
Created attachment 1336 [details]
patch to add parenthesis
Comment 5 Daniel Camara 2012-03-09 11:22:11 UTC
The patch worked for me :)
Comment 6 Daniel Camara 2012-03-12 07:33:32 UTC
Path applied
mercurial changeset: 7760:e98d9c028d7f