never, ever increments

a very, very odd thing....

#define BUFFER_SZ 64
unsigned char sBuf0tail;
sBuf0tail = ((sBuf0tail + 1) % BUFFER_SZ);

.. this increments a circular buffer index just fine.

#define BUFFER_SZ 64
unsigned char sBuf0tail;
sBuf0tail = ((sBuf0tail++) % BUFFER_SZ);

.. this one never, ever increments.

huh? is this some strange quirk of C I have never run into or is this a c51 compiler problem?

More questions in this forum