Closed mogenson closed 6 years ago
Looks like the SDCC prototypes in stdio.h were changed in August of 2017.
The Travis container is using SDCC version 3.3 for Ubuntu 14.04 from 2013.
Good point, however I think forcing a newer version of SDCC will break anyone who's using one of the stable downloads, since they are all 3.6 which predates this change: https://sourceforge.net/projects/sdcc/files/sdcc-linux-x86/ https://sourceforge.net/projects/sdcc/files/sdcc-win64/ https://sourceforge.net/projects/sdcc/files/sdcc-macosx/
Per the manual, this feature was introduced in SDCC 3.7: http://sdcc.sourceforge.net/doc/sdccman.pdf • In 3.7.0, the prototype for putchar() changed from void putchar(char) to int putchar(int)
so it looks like bracketing them in a conditional like this:
#if SDCC < 370
void putchar(char data);
char getchar();
#else
int putchar(int c);
int getchar(void);
#endif
should allow this to be version agnostic.
I suppose passing around 16-bit variables and then masking them out casually is a good reminder not to use printf unless absolutely necessary ;-)
Updated the pull request with conditionals.
Thanks!
Match getchar() and putchar() function declarations to SDCC
Add pre-flash make rule to examples for make flash
Tell git to ignore generated si5351 binary
sdcc --version