foo.cc: In function 'int main()':
foo.cc:11:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
for(x1=3;x1=x/2;x1+2)
~~^~~~
foo.cc:11:20: warning: for increment expression has no effect [-Wunused-value]
for(x1=3;x1=x/2;x1+2)
~~^~
foo.cc:21:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
if(x1=x2)
~~^~~
foo.cc:33:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
if(x1=x2)
~~^~~
foo.cc:10:6: warning: unused variable 'r' [-Wunused-variable]
int r;
^
foo.cc:6:18: warning: 'x1' is used uninitialized in this function [-Wuninitialized]
int x1,x2,x;x=x1+x2;
~~^~~
foo.cc:6:18: warning: 'x2' is used uninitialized in this function [-Wuninitialized]
foo.cc:38:6: warning: 'cnt' may be used uninitialized in this function [-Wmaybe-uninitialized]
cnt++;
~~~^~