Skip to content
Commit 78a6cdb0 authored by Joakim Andersson's avatar Joakim Andersson Committed by Johan Hedberg
Browse files

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: default avatarJoakim Andersson <joakim.andersson@nordicsemi.no>
parent 45e69215
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment