Open pklapperich opened 5 years ago
This should be correct:
int
putchar(int c) __reentrant
{
if (c == '\n')
_serial_write('\r');
_serial_write(c);
return c;
}
By the C standard, putchar() takes an int, and returns it (using an int allows for error reporting, by returning EOF).
Thank you, this stopped me too. With SDCC 3.8 , I needed to remove "-Werror" to get it compiled, - did you need it removed with 3.9 ?
I had to remove it for SDCC 3.9.5.
Unable to build with sdcc 3.9.0:
I changed the signature in serial.c to
and it's working fine for me. But I suspect there's a more correct fix.
I found what looks like the same issue on the sdcc mailing list from 2007, but the PUTCHAR definition doesn't exist, so the reply there was unhelpful.