-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing virtual declarations in Stream.h #10348
Fix missing virtual declarations in Stream.h #10348
Conversation
Fixes some changes made in PR espressif#10328
👋 Hello TD-er, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 56 files - 83 56 suites - 83 4m 45s ⏱️ - 1h 37m 11s Results for commit 7018619. ± Comparison against base commit 9e60bbe. This pull request removes 9 tests.
♻️ This comment has been updated with latest results. |
the virtual destructor should be in the Print class |
OK, but the virtual declaration of the other functions should be there. N.B. the Print class does have a virtual destructor, so I agree it is not needed in the |
As pointed out by @JAndrassy
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
@TD-er have you thought of proposing this upstream? |
Nope, as I don't know why it was already different on this repo to begin with. To me it makes perfect sense why those functions should be virtual, but I can't think of any reason why they are not made virtual in the upstream code. |
it also adds up to 3K of flash here too. Should you maybe rethink your code and not overwrite those? |
It does make both ESP32 and ESP8266 implementations different. Not sure what will happen when calling these functions when you have a pointer to the |
You can give it a shot. I think the derived class will be called. |
Nope, it will not. However, according to this, we could declare these functions with N.B. I don't know if I understood this alternative option 100% correct, so if I didn't please point me to the correct documentation or links to the standard or some examples. |
compiler will check if a virtual function with the specified name and parameters exists in the base class |
Yep, that's how I found this as the compiler complained. However the question is if we could do without |
Description of Change
Fixes some changes made in PR #10328
virtual
removedThese changes do cause issues when operating on a
Stream
pointer instead of the derived class.