Skip to content

Instantly share code, notes, and snippets.

@jonm
Created October 10, 2015 20:10
Show Gist options
  • Save jonm/ba420c534174f0a3d7e2 to your computer and use it in GitHub Desktop.
Save jonm/ba420c534174f0a3d7e2 to your computer and use it in GitHub Desktop.
using an assignment as a conditional
[~/src/SillyMUD/src]$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -Werror -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
comm.c:1538:18: error: using the result of an assignment as a condition without
parentheses [-Werror,-Wparentheses]
while (*point = *(i++))
~~~~~~~^~~~~~~~
comm.c:1538:18: note: place parentheses around the assignment to silence this
warning
while (*point = *(i++))
^
( )
comm.c:1538:18: note: use '==' to turn this assignment into an equality
comparison
while (*point = *(i++))
^
==
...
2 errors generated.
make: *** [comm.o] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment