Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

Conversation

bayrem-gharsellaoui
Copy link
Contributor

@bayrem-gharsellaoui bayrem-gharsellaoui commented Aug 5, 2024

Hello @oldrev,

First thank you for you effort of porting the ZephyrRTOS SMF to ESP-IDF.

By this PR I wanted to fix a simple C++ warning when building the project.

When using the component in a C++ project I get the following warning.

src/Apps/App.cpp:55:1: warning: missing initializer for member 'smf_state::parent' [-Wmissing-field-initializers] 55 | }; | ^ src/Apps/App.cpp:55:1: warning: missing initializer for member 'smf_state::parent' [-Wmissing-field-initializers] 

To resolve that we need to explicitly initialize all members of the structure including the parent member like the follwoing:

/**  * @brief Macro to create a flat state.  *  * @param _entry State entry function  * @param _run State run function  * @param _exit State exit function  */ #define SMF_CREATE_STATE(_entry, _run, _exit) \ { \	.entry = _entry, \	.run = _run, \	.exit = _exit, \	.parent = NULL \ }

Best regards
Bayrem

@oldrev
Copy link
Owner

oldrev commented Aug 5, 2024

Thanks for the contribution!

@oldrev oldrev merged commit ecbe26b into oldrev:master Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants