tinyfsm icon indicating copy to clipboard operation
tinyfsm copied to clipboard

Not able to compile with IAR ARM v8.20.2

Open microist opened this issue 5 years ago • 2 comments

TinyFSM v.0.3.2 can't be compiled using IAR ARM compiler (V8.20.2):

image

The compiler seems to think that the derived state classes are unreleated to the base class. Using GCC the same code compiles and works fine without any warnings.

Adding a reinterpret_cast in line 137 allows compilation, but maybe there is a better solution/workaround for this?

current_state_ptr = reinterpret_cast<state_ptr_t>(&_state_instance<S>::value);

Thanks and best regards Marvin

microist avatar May 14 '20 12:05 microist

Adding a reinterpret_cast should not break anything, I think this is fine as a workaround.

I'm hesitating a bit to add this to the code, as this should not be needed. I regard it as a compiler bug, and I've seen quite some in the past when it comes to templates.

digint avatar May 24 '20 17:05 digint

@ghost any news on this? do you know of any upstream (IAR ARM) fixes in that regard?

digint avatar May 14 '21 21:05 digint