> I'm trying to run the following line of code with SDCC on char *p:
>         *((unsigned short*)p)++ = 0x1234;
> 
> but it returns the following error:
>     P:\airway\code\reporter.c:128: error 10: 'lvalue' required for '++' 
> operation.
> 
> As far as I know, this should be a valid code segment to store an 
> integer at p and increment it by two characters.  It works with tcc, but 
> not with SDCC.  Anybody know why?

Cast-expressions are no lvalues, and thus cannot be assigned to (as per 
the ANSI standard).

Regards,
Raphael

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to