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

core: Fix compile errors on GCC 14 #1693

Merged

Conversation

arogge
Copy link
Member

@arogge arogge commented Jan 31, 2024

Backport of PR #1687 to bareos-23

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

Source code quality (if there were changes to the original PR)
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

Backport quality

Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just needs the fixes that happened to the original pr as well.

@arogge arogge force-pushed the backport/bareos-23/include-algorithm branch from 1316141 to 95b9363 Compare February 13, 2024 15:07
csfore and others added 3 commits February 15, 2024 11:11
Starting in GCC 14, it will no longer include <algorithm> by default,
resulting in compile errors for various projects.

https://gcc.gnu.org/gcc-14/porting_to.html

Errors:

core/src/cats/sql_get.cc:1309:42: error: cannot convert
'std::vector<std::__cxx11::basic_string<char> >::iterator' to
`const char*'

  1309 | jobids.erase(std::remove(jobids.begin(), jobids.end(),
    remove_jobid),

core/src/stored/append.cc:78:3: error: `for_each' was not declared in
this scope

 78 |   for_each(attributes_.begin(), attributes_.end(),

core/src/dird/ua_prune.cc:897:27: error: `remove_if' is not a member
of `std'; did you mean `remove_cv'?

  897 |     prune_list.erase(std::remove_if(prune_list.begin(),
     prune_list.end(),

Signed-off-by: Christopher Fore <csfore@posteo.net>
(cherry picked from commit 3907be7)
(cherry picked from commit fcdaf9f)
@arogge arogge force-pushed the backport/bareos-23/include-algorithm branch from 95b9363 to 395ef3e Compare February 15, 2024 10:11
@BareosBot BareosBot merged commit 15386c4 into bareos:bareos-23 Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants