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

[sigslots_lite] new c++14 insists on const expr init in the same translation unit #38

Merged
merged 2 commits into from
Sep 27, 2022

Conversation

stonier
Copy link
Owner

@stonier stonier commented Sep 27, 2022

This fixes the errors:

23:07:06   233 |                 static sigslots::GlobalSlot<Data> slots[capacity];
23:07:06       |                                                   ^~~~~
23:07:06 /tmp/binarydeb/ros-rolling-ecl-sigslots-lite-1.1.0/src/examples/../../include/ecl/sigslots_lite/managers.hpp: In static member function ‘static ecl::lite::sigslots::GlobalSlot<void>* ecl::lite::GlobalSlots<void, Dummy>::addSlot(void (*)())’:
23:07:06 /tmp/binarydeb/ros-rolling-ecl-sigslots-lite-1.1.0/src/examples/../../include/ecl/sigslots_lite/managers.hpp:368:51: error: ISO C++ forbids variable length array ‘slots’ [-Werror=vla]
23:07:06   368 |                 static sigslots::GlobalSlot<void> slots[capacity];

Basically, c++14 with -Wpedantic insists on initialisation of const expr (for array bounds) in the same translation unit. This redesigns it so storage is more (to the tune of about 5 lines) in the hands of the user.

@stonier stonier added the bug label Sep 27, 2022
@stonier stonier added this to the Humble milestone Sep 27, 2022
@stonier stonier self-assigned this Sep 27, 2022
@stonier stonier merged commit f9b8aa0 into devel Sep 27, 2022
@stonier stonier deleted the stonier/sigslots_revamp branch September 27, 2022 03:38
@stonier stonier mentioned this pull request Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant