On 08/28/2016 11:00 PM, Philipp Klaus Krause wrote:
> Wondering how printf("") might cause problems, I looked at the executed
> code in printf_large. Basically it should just do a read from the
> pointer, see that we are at the end of the string and return.
>
> So I found the read from a pointer is the problem. Placing a read from a
> generic pointer in main() causes the same issues as the call to printf()
> (as long a printf() is linked into the binary). The attached example
> code printf "Hello " again and again, but never "World!".
>
> Philipp
>

Just to confirm your findings I have this function as my "printf":


void send_string(unsigned char *string)
{
        while(*string)
                send_byte(*string++);   // Send string 1 byte at a time
}

And writing chars was fine but not strings.

MvH
Benjamin Larsson

------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to