[Bug c/57647] lvalue required as increment operand

2015-02-26 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/57647] lvalue required as increment operand

2013-06-19 Thread sch...@linux-m68k.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 --- Comment #8 from Andreas Schwab --- Postfix operators bind stronger than cast operators. If you need help on the C language then bugzilla is not the right place.

[Bug c/57647] lvalue required as increment operand

2013-06-19 Thread vijunag at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 --- Comment #7 from vijay Nag --- (In reply to vijay Nag from comment #6) > (In reply to Andreas Schwab from comment #5) > > ((unsigned long*)foo)++ and ((unsigned long *)foo++) are not equivalent > > expressions. The former is the same as foo =

[Bug c/57647] lvalue required as increment operand

2013-06-19 Thread vijunag at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 --- Comment #6 from vijay Nag --- (In reply to Andreas Schwab from comment #5) > ((unsigned long*)foo)++ and ((unsigned long *)foo++) are not equivalent > expressions. The former is the same as foo = (char *)((unsigned long*)foo + > 1), the latte

[Bug c/57647] lvalue required as increment operand

2013-06-19 Thread sch...@linux-m68k.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 --- Comment #5 from Andreas Schwab --- ((unsigned long*)foo)++ and ((unsigned long *)foo++) are not equivalent expressions. The former is the same as foo = (char *)((unsigned long*)foo + 1), the latter is foo += sizeof(*foo) (and the cast has no

[Bug c/57647] lvalue required as increment operand

2013-06-19 Thread vijunag at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 --- Comment #4 from vijay Nag --- (In reply to Marek Polacek from comment #3) > It should work for any type, but, why don't you do only foo++;, i.e. drop > the cast? In that case there shouldn't be value computed is not used > warning. Pointer A

[Bug c/57647] lvalue required as increment operand

2013-06-19 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 --- Comment #3 from Marek Polacek --- It should work for any type, but, why don't you do only foo++;, i.e. drop the cast? In that case there shouldn't be value computed is not used warning.

[Bug c/57647] lvalue required as increment operand

2013-06-19 Thread vijunag at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 --- Comment #2 from vijay Nag --- (In reply to Marek Polacek from comment #1) > While 4.7 issues warning: value computed is not used, 4.8 and 4.9 do not for > int > main () > { > char bar = 4; > char *foo = &bar; > (unsigned long *)foo++; >

[Bug c/57647] lvalue required as increment operand

2013-06-19 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647 Marek Polacek changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment #