Skip to content

Commit 57d200b

Browse files
FROMPULL: Update SYS_INIT_NAMED() to be C++ compatible
In zephyrproject-rtos#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 92138f7 commit 57d200b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/zephyr/init.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ struct init_entry {
163163
*
164164
* @see SYS_INIT()
165165
*/
166-
#define SYS_INIT_NAMED(name, init_fn_, level, prio) \
167-
static const Z_DECL_ALIGN(struct init_entry) \
168-
Z_INIT_ENTRY_SECTION(level, prio, 0) __used __noasan \
169-
Z_INIT_ENTRY_NAME(name) = {.init_fn = (init_fn_)} \
166+
#define SYS_INIT_NAMED(name, init_fn_, level, prio) \
167+
static const Z_DECL_ALIGN(struct init_entry) Z_INIT_ENTRY_SECTION(level, prio, 0) \
168+
__used __noasan \
169+
Z_INIT_ENTRY_NAME(name) = {.init_fn = (init_fn_), .dev = NULL}
170170

171171
/** @} */
172172

0 commit comments

Comments
 (0)