]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix compiler warnings about reaching end of non-void functions
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 7 Jun 2024 13:42:39 +0000 (15:42 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 15 Jul 2024 09:44:06 +0000 (11:44 +0200)
pdns/dnsdistdist/dnsdist-rule-chains.cc

index 340e4006fb4cd70a03b0be81f877ed8913bb4c6c..57e7b74ea06fb23c373c16344c4c6123bfe6eeb5 100644 (file)
@@ -55,6 +55,8 @@ std::vector<RuleAction>& getRuleChain(RuleChains& chains, RuleChain chain)
   case RuleChain::CacheMissRules:
     return chains.d_cacheMissRuleActions;
   }
+
+  throw std::runtime_error("Trying to accept an invalid rule chain");
 }
 
 const std::vector<RuleAction>& getRuleChain(const RuleChains& chains, RuleChain chain)
@@ -65,6 +67,8 @@ const std::vector<RuleAction>& getRuleChain(const RuleChains& chains, RuleChain
   case RuleChain::CacheMissRules:
     return chains.d_cacheMissRuleActions;
   }
+
+  throw std::runtime_error("Trying to accept an invalid rule chain");
 }
 
 std::vector<ResponseRuleAction>& getRuleChain(RuleChains& chains, ResponseRuleChain chain)
@@ -91,6 +95,8 @@ std::vector<ResponseRuleAction>& getResponseRuleChain(RuleChains& chains, Respon
   case ResponseRuleChain::XFRResponseRules:
     return chains.d_XFRRespRuleActions;
   }
+
+  throw std::runtime_error("Trying to accept an invalid response rule chain");
 }
 
 const std::vector<ResponseRuleAction>& getResponseRuleChain(const RuleChains& chains, ResponseRuleChain chain)
@@ -107,6 +113,8 @@ const std::vector<ResponseRuleAction>& getResponseRuleChain(const RuleChains& ch
   case ResponseRuleChain::XFRResponseRules:
     return chains.d_XFRRespRuleActions;
   }
+
+  throw std::runtime_error("Trying to accept an invalid response rule chain");
 }
 
 void add(RuleChains& chains, RuleChain identifier, const std::shared_ptr<DNSRule>& selector, const std::shared_ptr<DNSAction>& action, std::string&& name, const boost::uuids::uuid& uuid, uint64_t creationOrder)