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 warnings and optimize includes #11089

Merged
merged 3 commits into from
Jul 12, 2024
Merged

Fix warnings and optimize includes #11089

merged 3 commits into from
Jul 12, 2024

Conversation

roberth
Copy link
Member

@roberth roberth commented Jul 12, 2024

Motivation

  • Solve warnings
  • clangd reports a bunch about unused headers => solve warnings and make compilation slightly quicker

Context

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

roberth added 3 commits July 12, 2024 14:25
The move assignment was implicitly generated and used in

    src/libstore/build/goal.cc:90:22:
       90 |             this->ex = std::move(*ex);

Clang warns about this generated method being deprecated, so making
them explicit fixes the warning.
@roberth roberth added the contributor-experience Developer experience for Nix contributors label Jul 12, 2024
@github-actions github-actions bot added new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store repl The Read Eval Print Loop, "nix repl" command and debugger fetching Networking with the outside (non-Nix) world, input locking c api Nix as a C library with a stable interface labels Jul 12, 2024
Comment on lines +76 to +79
for (auto _ : path) {
(void)_;
++level;
}
Copy link
Member

Choose a reason for hiding this comment

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

Does this work?

Suggested change
for (auto _ : path) {
(void)_;
++level;
}
for (auto : path) ++level;

See also std::distance

Copy link
Member

Choose a reason for hiding this comment

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

Edit my suggestion did not. Let's try std::distance in a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Needs a difference member type. If we're adding members, I'd rather add an int depth() method that's implemented in whatever way.
For later.

@Ericson2314 Ericson2314 enabled auto-merge July 12, 2024 13:46
@Ericson2314 Ericson2314 merged commit 337a5a2 into master Jul 12, 2024
19 checks passed
@Ericson2314 Ericson2314 deleted the warnings-includes branch July 12, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api Nix as a C library with a stable interface contributor-experience Developer experience for Nix contributors fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger store Issues and pull requests concerning the Nix store
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants