romkatv / powerlevel10k

A Zsh theme
MIT License
46.64k stars 2.19k forks source link

Build failure with GCC 14.2 #2767

Open zeule opened 1 month ago

zeule commented 1 month ago
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 commented 1 month ago

I've removed -Werror.

zeule commented 1 month ago

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 commented 1 month ago

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