-
Notifications
You must be signed in to change notification settings - Fork 3k
Replace with weak mbed_error_hook implementation (deprecate the hook function) #12569
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
Conversation
Removing an existing API with no prior warning isn't ideal. Conceivably to retain compatibility you could have "call the registered handler" be the default weak implementation, and have the ability to override that. Although that makes it more complex, rather than simpler. Anyone else have thoughts? |
Maybe we could set this in mbed-os 5.15.x to deprecated and change it in mbed-os 6.x.x? |
@DBS06, thank you for your changes. |
I like the idea of using a weak mbed_error_hook implementation but we should only deprecate |
Is it okay to do it like in my last commit? |
How should I interpret |
Travis astyle job prints the failures, see https://travis-ci.org/github/ARMmbed/mbed-os/jobs/658578979 There is spaces left in the code (check for empty spaces after code or comment), all 3 offenders in the code style. |
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.
In this case, weakly linked is better than a hook.
Although working recently on some CMake where you get an issue with weakly defined symbols in libraries is not ideal world 🙄 but that is not related here, so all fine.
@evedon @kjbracey-arm what are your thoughts on this now ? |
Summary of changes
mbed_set_error_hook()
can only be called inside the application. Therefore it is not possible in the application to catch errors before callingmbed_set_error_hook()
.I thought it would be simpler to create a
mbed_error_hook()
function which is weak and the application can catch errors at any time.Impact of changes
Replace
mbed_set_error_hook()
with an application specificmbed_error_hook()
implementation.Migration actions required
Documentation
Pull request type
Test results
Reviewers