Skip to content

Commit be4334b

Browse files
tristan-googlekartben
authored andcommitted
device: Update SYS_INIT_NAMED() to be C++ compatible
In #84394, `struct init_entry` was modified to remove an unneeded union. The `SYS_INIT_NAMED()` macro was adjusted accordingly, but is no longer C++ compatible due to the partial designated initializer. Add an explicit value (NULL) for the other field (`dev`) in that struct. Signed-off-by: Tristan Honscheid <[email protected]>
1 parent 322b358 commit be4334b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/zephyr/init.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ struct init_entry {
166166
#define SYS_INIT_NAMED(name, init_fn_, level, prio) \
167167
static const Z_DECL_ALIGN(struct init_entry) \
168168
Z_INIT_ENTRY_SECTION(level, prio, 0) __used __noasan \
169-
Z_INIT_ENTRY_NAME(name) = {.init_fn = (init_fn_)} \
169+
Z_INIT_ENTRY_NAME(name) = {.init_fn = (init_fn_), .dev = NULL} \
170170

171171
/** @} */
172172

0 commit comments

Comments
 (0)