Changing internal Print::write_error to int

shawn

Well-known member
I'm wondering what any ramifications I haven't thought of would be to changing the internal "write error" type from `char` to `int`. The API uses an `int`, as does the internal variable in the AVR, ESP32, ESP8266 versions of Print.h.

Here's my PR: https://github.com/PaulStoffregen/cores/pull/696

The purpose is to make it interoperate better with stdio.

Links to other systems using `int` internally and not `char`:
1. https://github.com/arduino/ArduinoC...bec28b7f99099141473/cores/arduino/Print.h#L40
2. https://github.com/esp8266/Arduino/...1fa4f2a6bb912f7330a/cores/esp8266/Print.h#L38
3. https://github.com/espressif/arduin...bcc3e3782c1fadc95fbc8/cores/esp32/Print.h#L37
 
Actually, the real purpose is so information isn't lost. Interoperating with `ferror()` from stdio is a side benefit.
 
Back
Top