Skip to content

Commit 04611a5

Browse files
ElectricalPaulnashif
authored andcommitted
init: set init_entry.dev to NULL
[PR#51217](#51217) changed the `init_entry` structure, but `Z_INIT_ENTRY_NAME` (called by `SYS_INIT` or `SYS_INIT_NAMED`) does not initialize all of the members of the struct, leading to errors when building with `-Werror=missing-field-initializers`. Change the macro to initialize the `dev` member to `NULL` so that all members of the struct are initialized. Signed-off-by: Paul Fagerburg <[email protected]>
1 parent 76078ea commit 04611a5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/zephyr/init.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ struct init_entry {
154154
Z_INIT_ENTRY_SECTION(level, prio) __used __noasan \
155155
Z_INIT_ENTRY_NAME(name) = { \
156156
.init_fn = {.sys = (init_fn_)}, \
157+
.dev = NULL, \
157158
}
158159

159160
/** @} */

0 commit comments

Comments
 (0)