Skip to content

Fix reorder warning / error#1

Open
matteolel wants to merge 1 commit intoendurodave:masterfrom
dlaut:reorder
Open

Fix reorder warning / error#1
matteolel wants to merge 1 commit intoendurodave:masterfrom
dlaut:reorder

Conversation

@matteolel
Copy link
Copy Markdown

Compiler complains about wrong initialization order of currentState and _maxStates variables in StateMachine constructor.

Inverting order to fix the warning.

Original error:

StateMachineCompact/StateMachine.h:26:25: error: 'StateMachine::_maxStates' will be initialized after [-Werror=reorder]
StateMachineCompact/StateMachine.h:21:19: error: 'unsigned char StateMachine::currentState' [-Werror=reorder]
StateMachineCompact/StateMachine.cpp:4:1: error: when initialized here [-Werror=reorder]

Compiler complains about wrong initialization order of currentState and _maxStates variables in StateMachine constructor.

Inverting order to fix the warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant