[U-Boot-Users] old code compiled with new gcc. error: lvalue required
甜瓜
littlesweetmelon at gmail.com
Wed May 14 11:19:41 CEST 2008
Howdy,
I want to compile ppcboot 1.1.6 by ELDK 4.1. Well, ppcboot is very
ancient code, but for some reason, I have to compile it.
There are many exact same compile-time errors reported:
error: lvalue required as increment/decrement operand.
xsum += *((ushort *)ptr)++;
*((ulong *)addr_sp)-- = 0;
...
There are about 20 errors. Is there any walkaround? eg, compile options to
gcc that can use old C standard.
Again, a very obscure code:
viod some_func(ushort* ptr,...)
{
...
switch(SWAP16(*((ushort *)ptr)++) // @_@ how to deal with the
side-effect of ++?
{
case ...:
ptr2 = ptr; // ptr is ++-ed of to-be ++ ?
CallSomeOtherFunction(); // When calling, how about ptr....
...
}
}
Thank you for your attention.
---
ShenLei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20080514/4d4f8764/attachment.htm
More information about the U-Boot
mailing list