-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluetooth: host: Avoid use of array compound literals in API
Attempt to fix C++ error: taking address of temporary array. According to GCC documentation: In C++, a compound literal designates a temporary object that only lives until the end of its full-expression. Finishing with this recommendation: As an optimization, G++ sometimes gives array compound literals longer lifetimes: when the array either appears outside a function or has a const-qualified type. But it is probably safest just to avoid the use of array compound literals in C++ code. Fix the issue by introducing INIT macros as an alternative, and use these in the inline functions to avoid the use of array compound literals in Bluetooth headers. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
- Loading branch information
Showing
2 changed files
with
106 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters