Skip to content

Force callback non-trivial for IAR #13015

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

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions platform/Callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
// MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL - support storing non-trivial function objects
// MBED_CONF_PLATFORM_CALLBACK_COMPARABLE - support memcmp comparing stored objects (requires zero padding)

#ifdef __ICCARM__
/* Force platform.callback-nontrivial for IAR */
#undef MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL
#define MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redefining config options is icky, so I'd rather not. Can be confusing for any third parties (people or code) checking the option, potentially without looking or including here.

But I don't have a better suggestion. Don't think we can have a "toolchain override" for the JSON. I can live with this.

#endif


namespace mbed {
/** \addtogroup platform-public-api */
/** @{*/
Expand Down
2 changes: 1 addition & 1 deletion platform/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"value": 8
},
"callback-nontrivial": {
"help": "Enables support for non-trivial callable objects in Callback. Can be disabled to save ROM if no-one is using non-trivial types. Changing this value may cause incompatibility with pre-built binaries.",
"help": "Enables support for non-trivial callable objects in Callback. Can be disabled to save ROM if no-one is using non-trivial types. Changing this value may cause incompatibility with pre-built binaries. Choice not available with IAR, value forced to true.",
"value": false
},
"callback-comparable": {
Expand Down