From 2bbe3efd169534f538184ff788eecb398ead70a4 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Wed, 8 May 2024 18:50:03 -0600 Subject: [PATCH 1/2] add and fix -Wdeprecated-copy *so* many warnings, from only two definitions Change-Id: If2561cd500c05a1e33cce984faf9f3e42a8a95ac --- meson.build | 1 + src/libutil/fmt.hh | 2 ++ src/libutil/ref.hh | 2 ++ 3 files changed, 5 insertions(+) diff --git a/meson.build b/meson.build index 6231175e6..e90bf213b 100644 --- a/meson.build +++ b/meson.build @@ -405,6 +405,7 @@ add_project_arguments( '-Wimplicit-fallthrough', '-Werror=switch', '-Werror=switch-enum', + '-Wdeprecated-copy', # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked # at ~1% overhead in `nix search`. # diff --git a/src/libutil/fmt.hh b/src/libutil/fmt.hh index aa7c6926a..df4492993 100644 --- a/src/libutil/fmt.hh +++ b/src/libutil/fmt.hh @@ -185,6 +185,8 @@ public: HintFmt(const HintFmt & hf) : fmt(hf.fmt) {} + HintFmt & operator=(HintFmt const & rhs) = default; + std::string str() const { return fmt.str(); diff --git a/src/libutil/ref.hh b/src/libutil/ref.hh index 5d0c3696d..03aa64273 100644 --- a/src/libutil/ref.hh +++ b/src/libutil/ref.hh @@ -77,6 +77,8 @@ public: return ref((std::shared_ptr) p); } + ref & operator=(ref const & rhs) = default; + bool operator == (const ref & other) const { return p == other.p; From 1f9b0fba2304a24591dec6fe9b9623f147649d57 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Thu, 9 May 2024 07:00:51 -0600 Subject: [PATCH 2/2] add and fix -Wignored-qualifiers Change-Id: I4bffa766ae04dd80355f9b8c10e59700e4b406da --- meson.build | 1 + src/libfetchers/tarball.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e90bf213b..5885905c5 100644 --- a/meson.build +++ b/meson.build @@ -406,6 +406,7 @@ add_project_arguments( '-Werror=switch', '-Werror=switch-enum', '-Wdeprecated-copy', + '-Wignored-qualifiers', # Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked # at ~1% overhead in `nix search`. # diff --git a/src/libfetchers/tarball.cc b/src/libfetchers/tarball.cc index 68cb0ca40..cda6b7acb 100644 --- a/src/libfetchers/tarball.cc +++ b/src/libfetchers/tarball.cc @@ -186,7 +186,7 @@ struct CurlInputScheme : InputScheme virtual const std::string inputType() const = 0; const std::set transportUrlSchemes = {"file", "http", "https"}; - const bool hasTarballExtension(std::string_view path) const + bool hasTarballExtension(std::string_view path) const { return path.ends_with(".zip") || path.ends_with(".tar") || path.ends_with(".tgz") || path.ends_with(".tar.gz")