-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Platform: Allow copy of non copyable objects #5485
Conversation
@sg- @janjongboom Could you review this PR ? |
This should be enabled by default (warning, not error) for develop and release profile but error when in debug profile as other traps are also enabled. |
d243481
to
fef3e41
Compare
@sg- I've updated the PR to implement the expected behavior. |
\o/ |
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.
Many style changes that distract from actual changes, can you please split the style changes into own separate commit?
@@ -5,7 +5,7 @@ | |||
* \defgroup platform_toolchain Toolchain functions | |||
* @{ | |||
*/ | |||
|
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.
For future reviews, please style changes in a separate commit
@0xc0170 Yep, started a scan so it should soon start running. |
This macro yields a string literal of the enclosing function name.
Turn the compile time error issued when a NonCopyable resource is copied into a compile time and runtime warning. If the application is compiled with the debug profile the compile time error remains. The compile time error can be enforced by setting the library option force-non-copyable-error to true.
fef3e41
to
80c9f8b
Compare
@0xc0170 EOL whitespace in its own commit. |
/morph build |
Build : SUCCESSBuild number : 513 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 128 |
/morph test |
Test : SUCCESSBuild number : 330 |
Description
This patch adds the compile time configuration "non-copyable-warning" to mbed platform library. When this configuration flag is set to true, compile time errors resulting of the copy of a NonCopyable object are transformed into compile time and runtime warning.This may be useful for functional legacy code that erroneously copy non copyable resources. It is highly encouraged to fix non complying code; copy of objects not designed to be copied may lead to resources leak, operation on invalid memory location as well as random malfunctioning.This patch turns compile time errors resulting of the copy of a NonCopyable object into compile time and runtime warnings when the code is compiled with the develop or release profile. The compile time error is still issued when the code is compiled with the debug profile.
Compile time error can be enforced by setting the compile time configuration "force-non-copyable-error" to true.
This patch also adds the macro
MBED_PRETTY_FUNCTION
which yield the string literal of the enclosing function signature.Status
READY
Migrations
NO