WString: return bool instead of unsigned char#7939
WString: return bool instead of unsigned char#7939earlephilhower merged 2 commits intoesp8266:masterfrom
Conversation
Clean up the intent, resulting assembly stays the same.
earlephilhower
left a comment
There was a problem hiding this comment.
Thanks, I really like the idea, @mcspr !
That said, I'm worried about changing the signature of something as basic as String. Even today, in the ArduinoAPI repo String.h uses unsigned char. So this change would move our interface away from that, and break anything inheriting from String.
https://github.com/earlephilhower/ArduinoCore-API/blob/9da53735171f7cccbe781c66d9ee1068d94d6ec8/api/String.h
So I'm honestly not sure which way to go here. Let's discuss and see if we can get anyone else's input.
|
I may be missing the actual issue, but since this is not virtual inheritance methods do not depend on the base signature: Also opened a PR to the ArduinoCore-API with a similar change |
earlephilhower
left a comment
There was a problem hiding this comment.
Solid explanation. I'm happy to give this a shot and see if we uncover some weirdness in ancient libs, since it looks like the odds are very low.
Clean up the intent, resulting assembly stays the same as far as I could tell (objdump + vimdiff)
Follow-up #7781
if(s)helper is kind of redundant though, sincec_str()buffer()may never be nullptr and always points to something. Still needed to be compatible though, if something uses it