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

Build failure with GCC 14.2 #2767

Open
zeule opened this issue Sep 29, 2024 · 3 comments
Open

Build failure with GCC 14.2 #2767

zeule opened this issue Sep 29, 2024 · 3 comments

Comments

@zeule
Copy link

zeule commented Sep 29, 2024

src/index.cc: In function ‘std::vector<const char*> gitstatus::{anonymous}::ScanDirs(git_index*, int, gitstatus::IndexDir* const*, gitstatus::IndexDir* const*, const gitstatus::RepoCaps&, const gitstatus::ScanOpts&)’:
src/index.cc:295:21: error: array subscript -1 is outside array bounds of ‘char []’ [-Werror=array-bounds=]
  295 |         if (entry[-1] == DT_DIR) entry[basename.len++] = '/';
      |             ~~~~~~~~^
cc1plus: all warnings being treated as errors

Another question is why -Werror in the released tarballs?

@romkatv
Copy link
Owner

romkatv commented Oct 3, 2024

I've removed -Werror.

@zeule
Copy link
Author

zeule commented Oct 3, 2024

Thank you, but now I have another set of errors. Trying building the master branch I received:

In file included from src/check_dir_mtime.cc:36:
src/print.h:30:10: fatal error: git2.h: No such file or directory
   30 | #include <git2.h>
      |

I then installed libgit2-1.8.1 and with it the compiler says:

src/git.cc: In function ‘gitstatus::RemotePtr gitstatus::GetRemote(git_repository*, const git_reference*)’:
src/git.cc:192:7: error: ‘git_branch_remote’ was not declared in this scope; did you mean ‘git_branch_move’?
  192 |   if (git_branch_remote(&remote, &symref, repo, git_reference_name(local))) return nullptr;
      |       ^~~~~~~~~~~~~~~~~
      |       git_branch_move
src/git.cc: In function ‘gitstatus::PushRemotePtr gitstatus::GetPushRemote(git_repository*, const git_reference*)’:
src/git.cc:223:7: error: ‘git_branch_push_remote’ was not declared in this scope; did you mean ‘git_branch_upstream_remote’?
  223 |   if (git_branch_push_remote(&remote, &symref, repo, git_reference_name(local))) return nullptr;
      |       ^~~~~~~~~~~~~~~~~~~~~~
      |       git_branch_upstream_remote

Could you, please, suggest how to avoid these erros?

@zeule
Copy link
Author

zeule commented Oct 3, 2024

Ah, sorry. I see it wants libgit commit 82cefe2b42300224ad3c148f8b1a569757cc617a

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

No branches or pull requests

2 participants