HardwareSerial: Define no-op serialEvent() functions for clang#582
Open
beakthoven wants to merge 1 commit intoarduino:masterfrom
Open
HardwareSerial: Define no-op serialEvent() functions for clang#582beakthoven wants to merge 1 commit intoarduino:masterfrom
beakthoven wants to merge 1 commit intoarduino:masterfrom
Conversation
GCC automatically resolves weakly defined empty symbols to null if not overridden, but Clang doesn't resolve it this way. This causes undefined reference errors during linking. To address this, define empty no-op serialEvent() functions that can be overridden later since its weakly defined, ensuring compatibility with Clang and fixing the build issue. ref: avr-llvm/clang#9 Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
|
Memory usage change @ 698ad5d
Click for full report table
Click for full report CSV |
Collaborator
|
Looks ok to me. Did you verify this still works as expected on gcc (with and without a user serialEvent detected)? |
Author
The patch was successfully tested with GCC in Arduino ide, both with and without a user-defined serialEvent. The functionality works as expected in both cases. Test code: The code compiled perfectly and i was able to test it out with Serial monitor. A slight flash size reduction was observed when compiling code without a user-defined serialEvent function. This occurs because GCC now identifies the weak symbols as explicitly defined no-ops, allowing for more aggressive dead code elimination. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.