From: Remi Gacogne Date: Fri, 29 Jan 2021 15:57:24 +0000 (+0100) Subject: Silence warnings about values set but not used X-Git-Tag: dnsdist-1.6.0-alpha1~1^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90ee15b3204cab8734a34b6024ec7d8d4b1017ed;p=thirdparty%2Fpdns.git Silence warnings about values set but not used --- diff --git a/ext/yahttp/yahttp/router.cpp b/ext/yahttp/yahttp/router.cpp index a92be62b60..489f8cff1f 100644 --- a/ext/yahttp/yahttp/router.cpp +++ b/ext/yahttp/yahttp/router.cpp @@ -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(); diff --git a/pdns/dnsdist-xpf.cc b/pdns/dnsdist-xpf.cc index ebffa072c8..2b9f4fc4d1 100644 --- a/pdns/dnsdist-xpf.cc +++ b/pdns/dnsdist-xpf.cc @@ -52,6 +52,7 @@ bool addXPF(DNSQuestion& dq, uint16_t optionCode) pos += sizeof(drh); memcpy(reinterpret_cast(&data.at(pos)), payload.data(), payload.size()); pos += payload.size(); + (void) pos; dq.getHeader()->arcount = htons(ntohs(dq.getHeader()->arcount) + 1); diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index 4b96d7a951..0856ec847e 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -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); diff --git a/pdns/dnsdistdist/doh.cc b/pdns/dnsdistdist/doh.cc index e1e9c53c96..3d6d8cfc98 100644 --- a/pdns/dnsdistdist/doh.cc +++ b/pdns/dnsdistdist/doh.cc @@ -251,7 +251,6 @@ void handleDOHTimeout(DOHUnit* oldDU) sendDoHUnitToTheMainThread(oldDU, "DoH timeout"); oldDU->release(); - oldDU = nullptr; } struct DOHConnection diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index 808872761d..08233acc94 100644 --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -111,6 +111,7 @@ shared_ptr 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()); diff --git a/pdns/ednsoptions.cc b/pdns/ednsoptions.cc index 1b1b6ca617..97acca8040 100644 --- a/pdns/ednsoptions.cc +++ b/pdns/ednsoptions.cc @@ -37,6 +37,7 @@ bool getNextEDNSOption(const char* data, size_t dataLen, uint16_t& optionCode, u optionLen = (static_cast(p[pos]) * 256) + p[pos + 1]; pos += EDNS_OPTION_LENGTH_SIZE; + (void) pos; return true; } diff --git a/pdns/iputils.cc b/pdns/iputils.cc index a032629eaa..b8eb5e9219 100644 --- a/pdns/iputils.cc +++ b/pdns/iputils.cc @@ -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(reinterpret_cast(iov.iov_base) + written); - written = 0; } else if (res == 0) { return res; diff --git a/pdns/protozero.cc b/pdns/protozero.cc index 2217827ce2..28985f393f 100644 --- a/pdns/protozero.cc +++ b/pdns/protozero.cc @@ -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) { diff --git a/pdns/xpf.cc b/pdns/xpf.cc index 270428b4f1..2db6aaf75d 100644 --- a/pdns/xpf.cc +++ b/pdns/xpf.cc @@ -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; }