In C99 the construct (T){init-list} is called a compound literal, and
is an lvalue. In C++ it is simply a cast expression to non-rvalue
type, which is a prvalue. In both languages the expression is a
temporary, but in C99 taking its address is well-defined while in C++
it is an error diagnosed as "taking address of temporary".
Headers that may be used in C++ application code must avoid invalid
expressions. Replace all uses of &(T){init-list} in headers with the
functionally equivalent but C++-legal (T[]){{init-list}}.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The unnamed unions inside json_obj_descr struct causes issues
with the initializer macros due to bug described here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
The issue is that for GCC < 4.6, it cannot handle unnamed
fields in initializers. So apply the workarounds described
in the bug report.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This patch reorders designated initializers to satisfy C++ requiring
that designated initializers appear in the same order as the members
they initialize.
Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
This patch adds `extern "C"` linkage directives so the header files can
be included by C++ source files.
Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move zephyr/jwt.h to data/jwt.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move json.h to data/json.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>