Hello,

Thank you for your reply.
However the --nooverlay does not help.

I've tried a different code:

uchar test_func(uchar x) {
return x+48;
}

void main(void) {
uchar i;

while(1) {
i = 48;
uart_writeByte('A'); //'A' is sent
i = test_func(6); //SHOULD return 48+6
uart_writeByte(48+2); //'2' is sent
uart_writeByte(i+1); //character before + 1 is sent??!!!  (2+1 = 3) (independent of i=48 initialization)
i = 48+7;
uart_writeByte(i+1); //'8' is sent?!
}
}
here is the output: "A238A238A238"

i stays unchanged in the line "i = test_func(6)" ?

--------------------------------------------------------------------

replacing the test_func by
void test_func(uchar x, uchar *r) {
*r = x + 48;
}

void main(void) {
uchar i;

while(1) {
i = 48;
uart_writeByte('A'); //'A' is sent
test_func(6, &i); // i is not modified?!
uart_writeByte(48+2); //'2' is sent
uart_writeByte(i+1); //'1' is sent, but it should be '7' ??!!
i = 48+7;
uart_writeByte(i+1);    //'8' is sent
}
}

produces this data:
"A218A218A218"

This behavior is independent of any optimization flags.

Again, exactly the same source on a 18f4550 works as expected. ( "A278A278A278" )

Nice greetings,
Georges

On 4 Oct 2008, at 21:58, Arkadi Shishlov wrote:

Georges Engelmann wrote:
Now compiling exactly the same source code (or even using the hex-file
for the 4550) for a pic18f4680 produces the following output:
"A≥A„AACAsA£A”A"
The parameter '6' in test_func is somehow not properly transmitted to
the function?!

In a similar situation the --nooverlay flag solved the problem for me (pic14 port).

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user