GCC 4 Woes
Dan Williams
dcbw at redhat.com
Thu Apr 14 20:40:46 UTC 2005
On Thu, 2005-04-14 at 16:04 -0400, Gregory Hayes wrote:
> In my quest to play my DivX files under FC4t2 I found that I can't get
> either MPlayer or Xine to compile (old RPMs for FC3 from livna won't
> work). GCC usually dies with this error:
>
> error: invalid lvalue in increment
>
> As an example, below is a line of code that generates this:
>
> n1 = *(((unsigned int *) src1)++);
>
> What is the correct way to do the same thing under GCC 4 w/o
> triggering the above error?
Split up (1) the assignment of *src1 -> n1, and (2) the increment of
src1 into two distinct lines of code. gcc 4 tightens handling of
lvalues and rvalues, which this code is abusing.
dan
More information about the test
mailing list