I need some advice with this strange behavior – lets have this code:
int ** p;
This compiles without any trouble:
p++;
But this:
((int**)p)++;
Gives me this error message: “error: lvalue required as increment operand”
.
I am casting to p
to the type it already is, nothing changes, so what is the problem? This is simplified version of problem I came across, when I was trying to compile one old
version of gdb
. So I suppose, that this worked and something changed. Any idea what is wrong with the second example?