Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve reliability of the Callback implementation#755

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
facchinm merged 2 commits intoarduino:mainfromalrvid:main
Nov 13, 2023
Merged
Changes fromall 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
11 changes: 10 additions & 1 deletioncores/arduino/mbed/platform/include/platform/Callback.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,6 +26,14 @@
#include <mstd_type_traits>
#include <mstd_functional>

#pragma GCC push_options
// This prevents the GCC compiler from applying optimizations that assume the code follows strict aliasing rules.
// In order to prevent bugs arising from undefined behavior that is tricky to find in the Callback implementation,
// or simply from compiler bugs in GCC.
#pragma GCC optimize("-fno-strict-aliasing")
// This prevents the GCC compiler from generating incorrect inline code for the Callback constructor.
#pragma GCC optimize("-fno-inline")

// Controlling switches from config:
// MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL - support storing non-trivial function objects
// MBED_CONF_PLATFORM_CALLBACK_COMPARABLE - support memcmp comparing stored objects (requires zero padding)
Expand All@@ -36,7 +44,6 @@
#define MBED_CONF_PLATFORM_CALLBACK_NONTRIVIAL 1
#endif


namespace mbed {
/** \addtogroup platform-public-api */
/** @{*/
Expand DownExpand Up@@ -835,4 +842,6 @@ Callback(R(*func)(const volatile T *, ArgTs...), const volatile U *arg) -> Callb

} // namespace mbed

#pragma GCC pop_options

#endif

[8]ページ先頭

©2009-2025 Movatter.jp