I use for my PIC18f258 the SDCC Compiler.
I use Snapshot Versions from http://sdcc.sourceforge.net/snap.php
sdcc-snapshot-i586-mingw32msvc-20120131-7268.zip 8524 K Jan 31 09:31
Postincrement working incorrect!
....
unsigned char VarBuffer[10], *BytePointer;
BytePointer = VarBuffer;
*BytePointer++ = 1; //BytePointer to be not incrementiert!
The line "*BytePointer++ = 1;" should act the same as "*(BytePointer++) = 1;".
The post-increment (++) has a higher precedence than the indirection (*), so after running that line VarBuffer[0] *should* be set to 1, and BytePointer *should* be incremented to point to VarBuffer[1].
Is that what you are seeing, or are you seeing something more like "(*BytePointer)++" ?
http://en.wikibooks.org/wiki/C_Programming/Reference_Tables#Table_of_Operators
code to reproduce the problem
This affects all ports: Using the attached file with a (global) BytePointer, even
sdcc b3482217.c --i-code-in-asm --nogcse --nooverlay --nolabelopt --noinvariant --noinduction --nojtbound --noloopreverse --no-peep --dumpall -c
looses the pointer increment (in both functions) somewhere during i-code optimization: in .dumppack, .dumprange and .dumprassgn the increment i-code is gone, all other .dump* (still) include it.
Increasing priority, since bad code is generated silently.
Philipp
Fixed in revision #7276.
Philipp