Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating HFSM2 from 1.8.0 to 1.11.2 caused compiler notes, when using gcc #61

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

lbakman
Copy link
Contributor

@lbakman lbakman commented Nov 23, 2021

Tried to upgrade HFSM2 in our project from version 1.8.0 to 1.11.2, and received a number of compiler notes, concerning a missing default constructor and "the implicitly-defined constructor does not initialize" StaticArrayT::_items (see below).

These notes may not have any detrimental effects on the output, but this pull request adds initialisation to the _items declaration. This removes the notes from my compiler output.

hfsm2/machine.hpp: In instantiation of ‘constexpr void hfsm2::detail::R_<TConfig, TApex>::initialEnter() [with TConfig = hfsm2::detail::G_<5, StateContext&, hfsm2::Automatic, 4, 65535, void>; TApex = hfsm2::detail::CI_<(hfsm2::detail::Strategy)0, void, Idle, Starting, Running, Stopping>]’: hfsm2/machine.hpp:14053:15: required from ‘constexpr hfsm2::detail::RV_<hfsm2::detail::G_<NFeatureTag, TContext, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::RV_(typename hfsm2::detail::RV_<hfsm2::detail::G_<NFeatureTag, TContext, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::Base::Context&) [with short unsigned int NFeatureTag = 5; TContext = StateContext&; TActivation = hfsm2::Automatic; short unsigned int NSubstitutionLimit = 4; short unsigned int NTaskCapacity = 65535; TPayload = void; TApex = hfsm2::detail::CI_<(hfsm2::detail::Strategy)0, void, Idle, Starting, Running, Stopping>; typename hfsm2::detail::RV_<hfsm2::detail::G_<NFeatureTag, TContext, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::Base::Context = StateContext&]’ hfsm2/machine.hpp:14419:14: required from ‘constexpr hfsm2::detail::RC_<hfsm2::detail::G_<NFeatureTag, TContext&, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::RC_(typename hfsm2::detail::RC_<hfsm2::detail::G_<NFeatureTag, TContext&, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::Base::Context) [with short unsigned int NFeatureTag = 5; TContext = StateContext; TActivation = hfsm2::Automatic; short unsigned int NSubstitutionLimit = 4; short unsigned int NTaskCapacity = 65535; TPayload = void; TApex = hfsm2::detail::CI_<(hfsm2::detail::Strategy)0, void, Idle, Starting, Running, Stopping>; typename hfsm2::detail::RC_<hfsm2::detail::G_<NFeatureTag, TContext&, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::Base::Context = StateContext&]’ hfsm2/machine.hpp:14666:14: required from here hfsm2/machine.hpp:5013:8: note: ‘using RegistryBackUp = using BackUp = struct hfsm2::detail::BackUpT<hfsm2::detail::RegistryT<hfsm2::detail::ArgsT<StateContext&, hfsm2::detail::G_<5, StateContext&, hfsm2::Automatic, 4, 65535, void>, hfsm2::detail::TL_<void, Idle, Starting, Running, Stopping>, hfsm2::detail::TL_<void>, 1, 0, 0, 4, 8, void> > >’ {aka ‘struct hfsm2::detail::BackUpT<hfsm2::detail::RegistryT<hfsm2::detail::ArgsT<StateContext&, hfsm2::detail::G_<5, StateContext&, hfsm2::Automatic, 4, 65535, void>, hfsm2::detail::TL_<void, Idle, Starting, Running, Stopping>, hfsm2::detail::TL_<void>, 1, 0, 0, 4, 8, void> > >’} has no user-provided default constructor struct BackUpT final { ^~~~~~~ hfsm2/machine.hpp:2293:22: note: and the implicitly-defined constructor does not initialize ‘hfsm2::detail::StaticArrayT<unsigned char, 1>::Item hfsm2::detail::StaticArrayT<unsigned char, 1>::_items [1]’ Item _items[CAPACITY];

hfsm2/machine.hpp: In instantiation of ‘constexpr void hfsm2::detail::R_<TConfig, TApex>::initialEnter() [with TConfig = hfsm2::detail::G_<5, StateContext&, hfsm2::Automatic, 4, 65535, void>; TApex = hfsm2::detail::CI_<(hfsm2::detail::Strategy)0, void, Idle, Starting, Running, Stopping>]’:
hfsm2/machine.hpp:14053:15:   required from ‘constexpr hfsm2::detail::RV_<hfsm2::detail::G_<NFeatureTag, TContext, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::RV_(typename hfsm2::detail::RV_<hfsm2::detail::G_<NFeatureTag, TContext, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::Base::Context&) [with short unsigned int NFeatureTag = 5; TContext = StateContext&; TActivation = hfsm2::Automatic; short unsigned int NSubstitutionLimit = 4; short unsigned int NTaskCapacity = 65535; TPayload = void; TApex = hfsm2::detail::CI_<(hfsm2::detail::Strategy)0, void, Idle, Starting, Running, Stopping>; typename hfsm2::detail::RV_<hfsm2::detail::G_<NFeatureTag, TContext, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::Base::Context = StateContext&]’
hfsm2/machine.hpp:14419:14:   required from ‘constexpr hfsm2::detail::RC_<hfsm2::detail::G_<NFeatureTag, TContext&, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::RC_(typename hfsm2::detail::RC_<hfsm2::detail::G_<NFeatureTag, TContext&, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::Base::Context) [with short unsigned int NFeatureTag = 5; TContext = StateContext; TActivation = hfsm2::Automatic; short unsigned int NSubstitutionLimit = 4; short unsigned int NTaskCapacity = 65535; TPayload = void; TApex = hfsm2::detail::CI_<(hfsm2::detail::Strategy)0, void, Idle, Starting, Running, Stopping>; typename hfsm2::detail::RC_<hfsm2::detail::G_<NFeatureTag, TContext&, TActivation, NSubstitutionLimit, NTaskCapacity, TPayload>, TApex>::Base::Context = StateContext&]’
hfsm2/machine.hpp:14666:14:   required from here
hfsm2/machine.hpp:5013:8: note: ‘using RegistryBackUp = using BackUp = struct hfsm2::detail::BackUpT<hfsm2::detail::RegistryT<hfsm2::detail::ArgsT<StateContext&, hfsm2::detail::G_<5, StateContext&, hfsm2::Automatic, 4, 65535, void>, hfsm2::detail::TL_<void, Idle, Starting, Running, Stopping>, hfsm2::detail::TL_<void>, 1, 0, 0, 4, 8, void> > >’ {aka ‘struct hfsm2::detail::BackUpT<hfsm2::detail::RegistryT<hfsm2::detail::ArgsT<StateContext&, hfsm2::detail::G_<5, StateContext&, hfsm2::Automatic, 4, 65535, void>, hfsm2::detail::TL_<void, Idle, Starting, Running, Stopping>, hfsm2::detail::TL_<void>, 1, 0, 0, 4, 8, void> > >’} has no user-provided default constructor
 struct BackUpT final {
        ^~~~~~~
hfsm2/machine.hpp:2293:22: note: and the implicitly-defined constructor does not initialize ‘hfsm2::detail::StaticArrayT<unsigned char, 1>::Item hfsm2::detail::StaticArrayT<unsigned char, 1>::_items [1]’
  Item _items[CAPACITY];
@andrew-gresyk
Copy link
Owner

Nice, thanks for the PR

@andrew-gresyk andrew-gresyk merged commit f9134d5 into andrew-gresyk:master Nov 23, 2021
andrew-gresyk added a commit that referenced this pull request Nov 23, 2021
* moved dev sources from /include to /development folder
* fixed a static analysis issue in test_debug.cpp
@andrew-gresyk andrew-gresyk mentioned this pull request Nov 23, 2021
andrew-gresyk added a commit that referenced this pull request Nov 23, 2021
fixed StaticArrayT<>::_items initialization (based on #61)
* moved dev sources from /include to /development folder
* fixed a static analysis issue in test_debug.cpp
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.

2 participants