digint / tinyfsm

A simple C++ finite state machine library
https://digint.ch/tinyfsm
MIT License
931 stars 173 forks source link

FSM with identical state names compile, but segfault at runtime #4

Closed esromneb closed 6 years ago

esromneb commented 6 years ago

If I have two state machines with identical states Reset

And they are both setup with FSM_INITIAL_STATE(FsmA, Reset)

The code compiles fine, but it seems to seg fault. Any tips here? Thanks.

digint commented 6 years ago

If you have two state machines, wouldn't it be:

FSM_INITIAL_STATE(FsmA, Reset)
FSM_INITIAL_STATE(FsmB, Reset)

tinyfsm is all about static types, so you can't have two state machines of same type.