[Bug c/57647] lvalue required as increment operand

vijunag at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jun 19 08:40:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57647

--- Comment #6 from vijay Nag <vijunag at gmail dot com> ---
(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 latter is foo += sizeof(*foo) (and the cast has no effect).

((unsigned long*)foo)++ is no longer a valid C expression for the cast
evaluates it to be an R-value rather than L-value



More information about the Gcc-bugs mailing list