]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Silence warnings about values set but not used
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 29 Jan 2021 15:57:24 +0000 (16:57 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 29 Jan 2021 15:57:24 +0000 (16:57 +0100)
ext/yahttp/yahttp/router.cpp
pdns/dnsdist-xpf.cc
pdns/dnsdist.cc
pdns/dnsdistdist/doh.cc
pdns/dnsparser.cc
pdns/ednsoptions.cc
pdns/iputils.cc
pdns/protozero.cc
pdns/xpf.cc

index a92be62b6022b1460b42112a24d935e2bd1ef402..489f8cff1f9658a43558b8f9059509171dacf827 100644 (file)
@@ -53,7 +53,6 @@ namespace YaHTTP {
             pname = pname.substr(1);
             // this matches whatever comes after it, basically end of string
             pos2 = req->url.path.size();
-            matched = true;
             if (pname != "") 
               params[pname] = funcptr::tie(pos1,pos2);
             k1 = url.size();
index ebffa072c837b11a28d3f5e002e6beccf6cf064a..2b9f4fc4d179b6c9af468de36f6faa014122469d 100644 (file)
@@ -52,6 +52,7 @@ bool addXPF(DNSQuestion& dq, uint16_t optionCode)
   pos += sizeof(drh);
   memcpy(reinterpret_cast<char*>(&data.at(pos)), payload.data(), payload.size());
   pos += payload.size();
+  (void) pos;
 
   dq.getHeader()->arcount = htons(ntohs(dq.getHeader()->arcount) + 1);
 
index 4b96d7a9510b3291f570d71711a963dfb6cef43c..0856ec847ef1c518f8cdc71ffea0d71b96479bf8 100644 (file)
@@ -2184,8 +2184,10 @@ int main(int argc, char** argv)
       }
     }
 
-    argc-=optind;
-    argv+=optind;
+    argc -= optind;
+    argv += optind;
+    (void) argc;
+
     for(auto p = argv; *p; ++p) {
       if(g_cmdLine.beClient) {
         clientAddress = ComboAddress(*p, 5199);
index e1e9c53c96180c372b5024c0b37e8cffb6700b4d..3d6d8cfc984d79f9cbf19fe2318b818e87409c6c 100644 (file)
@@ -251,7 +251,6 @@ void handleDOHTimeout(DOHUnit* oldDU)
   sendDoHUnitToTheMainThread(oldDU, "DoH timeout");
 
   oldDU->release();
-  oldDU = nullptr;
 }
 
 struct DOHConnection
index 808872761ddb64699610dbbc008269308e170c8c..08233acc94f7c412c7a57b74fbb1f6f0573a721b 100644 (file)
@@ -111,6 +111,7 @@ shared_ptr<DNSRecordContent> DNSRecordContent::deserialize(const DNSName& qname,
   if (serialized.size() > 0) {
     memcpy(&packet[pos], serialized.c_str(), serialized.size());
     pos += (uint16_t) serialized.size();
+    (void) pos;
   }
 
   MOADNSParser mdp(false, (char*)&*packet.begin(), (unsigned int)packet.size());
index 1b1b6ca6176d7eb2765799562f1f62deeaad86d8..97acca80401f77d194df5987a6964bc10b9db6de 100644 (file)
@@ -37,6 +37,7 @@ bool getNextEDNSOption(const char* data, size_t dataLen, uint16_t& optionCode, u
 
   optionLen = (static_cast<uint16_t>(p[pos]) * 256) + p[pos + 1];
   pos += EDNS_OPTION_LENGTH_SIZE;
+  (void) pos;
 
   return true;
 }
index a032629eaa05ed8daeb08da56092859c872eb9bf..b8eb5e9219fe7c5c5aa34b161ea0f6df48a13c0f 100644 (file)
@@ -390,7 +390,6 @@ size_t sendMsgWithOptions(int fd, const char* buffer, size_t len, const ComboAdd
       firstTry = false;
       iov.iov_len -= written;
       iov.iov_base = reinterpret_cast<void*>(reinterpret_cast<char*>(iov.iov_base) + written);
-      written = 0;
     }
     else if (res == 0) {
       return res;
index 2217827ce2741ea8b0dbcf1bb932aae480126f70..28985f393fc1dc66dd6331c249c5741828a3fc4f 100644 (file)
@@ -107,6 +107,8 @@ void pdns::ProtoZero::Message::addRRsFromPacket(const char* packet, const size_t
   rrname = pr.getName();
   rrtype = pr.get16BitInt();
   rrclass = pr.get16BitInt();
+  (void) rrtype;
+  (void) rrclass;
 
   /* consume remaining qd if any */
   if (qdcount > 1) {
index 270428b4f1469849938fc891edc163ccfbb77eff..2db6aaf75dc589c76b51d4ee7fe4a0ecfccbcf92 100644 (file)
@@ -108,6 +108,8 @@ bool parseXPFPayload(const char* payload, size_t len, ComboAddress& source, Comb
 
   memcpy(&destinationPort, payload + pos, sizeof(destinationPort));
   pos += sizeof(destinationPort);
+  (void) pos;
+
   if (destination != nullptr) {
     destination->sin4.sin_port = destinationPort;
   }