-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
HardwareSerial: Define no-op serialEvent() functions for clang #582
base: master
Are you sure you want to change the base?
HardwareSerial: Define no-op serialEvent() functions for clang #582
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 <[email protected]>
Memory usage change @ 698ad5d
Click for full report table
Click for full report CSV
|
Looks ok to me. Did you verify this still works as expected on gcc (with and without a user serialEvent detected)? |
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. |
No description provided.