From 844535e5d70a2764b3bd03320c31ae0a4f5cce9c Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 19 May 2021 19:44:12 +0200 Subject: [PATCH] auth: Fix a 'temporary used in loop' warning reported by g++ 11.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ``` common_startup.cc: In function ‘void mainthread()’: common_startup.cc:617:24: warning: loop variable ‘algotype’ of type ‘const string&’ {aka ‘const std::__cxx11::basic_string&’} binds to a temporary constructed from type ‘const char* const’ [-Wrange-loop-construct] 617 | for (const string& algotype : {"ksk", "zsk"}) { | ^~~~~~~~ common_startup.cc:617:24: note: use non-reference type ‘const string’ {aka ‘const std::__cxx11::basic_string’} to make the copy explicit or ‘const char* const&’ to prevent copying ``` --- pdns/common_startup.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 88963c2a46..c340596492 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -614,7 +614,7 @@ void mainthread() // Some sanity checking on default key settings bool hadKeyError = false; int kskAlgo{0}, zskAlgo{0}; - for (const string& algotype : {"ksk", "zsk"}) { + for (const string algotype : {"ksk", "zsk"}) { int algo, size; if (::arg()["default-"+algotype+"-algorithm"].empty()) continue; -- 2.47.2