-
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
change(build): add -Werror=return-type to default C and C++ flags #10216
Conversation
👋 Hello igrr, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
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]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of Change
-Werror=return-type
should help catch potential causes of run-time UB.See esp8266/Arduino#8160 for the original issue report.
This flag has been:
Tests scenarios
Compiled test.ino:
Resulted in, at "Default" warnings level:
At "None" warnings level, compilation is successful.
Same code, compiled in a .c file instead of .ino
Additional considerations
In esp8266/Arduino, special care is taken so that this flag is not disabled when "None" warnings level is selected in the IDE (see this and this). However,
So I kept the simpler behavior that this warning doesn't occur when "None" warnings level is selected.
Related links
Closes #5867