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

fix: replace std::for_each_n for gcc 8 build failure #44

Merged
merged 1 commit into from
Mar 17, 2024

Conversation

tearfur
Copy link
Contributor

@tearfur tearfur commented Mar 16, 2024

Our NetBSD CI over at the Transmission project found that std::for_each_n is not supported by GCC 8 for whatever reason.

The solution in this PR is already tested to build successfully.

In file included from ../../third-party/small/include/small/map.hpp:11,
                 from ../../libtransmission/announce-list.cc:11:
../../third-party/small/include/small/vector.hpp: In member function 'constexpr small::vector<T, N, Allocator, AllowHeap, SizeType, GrowthFactor>::iterator small::vector<T, N, Allocator, AllowHeap, SizeType, GrowthFactor>::erase(small::vector<T, N, Allocator, AllowHeap, SizeType, GrowthFactor>::const_iterator, small::vector<T, N, Allocator, AllowHeap, SizeType, GrowthFactor>::const_iterator)':
../../third-party/small/include/small/vector.hpp:1090:26: error: 'for_each_n' is not a member of 'std'
                     std::for_each_n(
                          ^~~~~~~~~~
../../third-party/small/include/small/vector.hpp:1090:26: note: suggested alternative: 'for_each'
                     std::for_each_n(
                          ^~~~~~~~~~
                          for_each
Process exited with code 1

@tearfur
Copy link
Contributor Author

tearfur commented Mar 16, 2024

CI failure is most likely unrelated to the change. We've been seeing segfaults in Ubuntu CI jobs from non-Cpp PRs.

@alandefreitas
Copy link
Owner

Yes. It should be unrelated.

@alandefreitas alandefreitas merged commit c63eef6 into alandefreitas:develop Mar 17, 2024
4 of 5 checks passed
@tearfur tearfur deleted the gcc-8 branch March 17, 2024 03:02
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