Simple substitution for * ((unsigned short *)ptr)++ = XXXX ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

This following statement fails in the latest gcc (4.3.3):
 * ((unsigned short *)ptr)++ = XXXX;

The messages are: `lvalue required as increment operand'.
It is really a very convenient way of saving to the current
pointer and then moving the pointer forward or backward.

It is a little complex to replace the statement with
	* ((unsigned short *)ptr) = XXXX; ptr += sizeof(unsigned short);

Why gcc does not support the style? And there is another simple
substitution for that?

---
PRC
Aug 19,2010


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux