From: Fred Morcos Date: Tue, 14 Feb 2023 08:53:58 +0000 (+0100) Subject: Fix unused argument warnings X-Git-Tag: dnsdist-1.8.0-rc1~3^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d73de874e48eaf86d942954ddc36731e24b14ed9;p=thirdparty%2Fpdns.git Fix unused argument warnings --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index 0d4e1c8d62..931952d4e8 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -275,7 +275,7 @@ bool Bind2Backend::abortTransaction() return true; } -bool Bind2Backend::feedRecord(const DNSResourceRecord& rr, const DNSName& ordername, bool ordernameIsNSEC3) +bool Bind2Backend::feedRecord(const DNSResourceRecord& rr, const DNSName& /* ordername */, bool /* ordernameIsNSEC3 */) { if (d_transaction_id < 1) { throw DBException("Bind2Backend::feedRecord() called outside of transaction"); @@ -318,7 +318,7 @@ bool Bind2Backend::feedRecord(const DNSResourceRecord& rr, const DNSName& ordern return true; } -void Bind2Backend::getUpdatedMasters(vector& changedDomains, std::unordered_set& catalogs, CatalogHashMap& catalogHashes) +void Bind2Backend::getUpdatedMasters(vector& changedDomains, std::unordered_set& /* catalogs */, CatalogHashMap& /* catalogHashes */) { vector consider; { @@ -362,7 +362,7 @@ void Bind2Backend::getUpdatedMasters(vector& changedDomains, std::un } } -void Bind2Backend::getAllDomains(vector* domains, bool getSerial, bool include_disabled) +void Bind2Backend::getAllDomains(vector* domains, bool getSerial, bool /* include_disabled */) { SOAData soadata; @@ -562,7 +562,7 @@ void Bind2Backend::insertRecord(std::shared_ptr& records, const records->insert(std::move(bdr)); } -string Bind2Backend::DLReloadNowHandler(const vector& parts, Utility::pid_t ppid) +string Bind2Backend::DLReloadNowHandler(const vector& parts, Utility::pid_t /* ppid */) { ostringstream ret; @@ -587,7 +587,7 @@ string Bind2Backend::DLReloadNowHandler(const vector& parts, Utility::pi return ret.str(); } -string Bind2Backend::DLDomStatusHandler(const vector& parts, Utility::pid_t ppid) +string Bind2Backend::DLDomStatusHandler(const vector& parts, Utility::pid_t /* ppid */) { ostringstream ret; @@ -649,7 +649,7 @@ static void printDomainExtendedStatus(ostringstream& ret, const BB2DomainInfo& i ret << "\t Last notified: " << info.d_lastnotified << std::endl; } -string Bind2Backend::DLDomExtendedStatusHandler(const vector& parts, Utility::pid_t ppid) +string Bind2Backend::DLDomExtendedStatusHandler(const vector& parts, Utility::pid_t /* ppid */) { ostringstream ret; @@ -678,7 +678,7 @@ string Bind2Backend::DLDomExtendedStatusHandler(const vector& parts, Uti return ret.str(); } -string Bind2Backend::DLListRejectsHandler(const vector& parts, Utility::pid_t ppid) +string Bind2Backend::DLListRejectsHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { ostringstream ret; auto rstate = s_state.read_lock(); @@ -689,7 +689,7 @@ string Bind2Backend::DLListRejectsHandler(const vector& parts, Utility:: return ret.str(); } -string Bind2Backend::DLAddDomainHandler(const vector& parts, Utility::pid_t ppid) +string Bind2Backend::DLAddDomainHandler(const vector& parts, Utility::pid_t /* ppid */) { if (parts.size() < 3) return "ERROR: Domain name and zone filename are required"; @@ -1075,7 +1075,7 @@ void Bind2Backend::queueReloadAndStore(unsigned int id) } } -bool Bind2Backend::findBeforeAndAfterUnhashed(std::shared_ptr& records, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) +bool Bind2Backend::findBeforeAndAfterUnhashed(std::shared_ptr& records, const DNSName& qname, DNSName& /* unhashed */, DNSName& before, DNSName& after) { // for(const auto& record: *records) // cerr<& primaries) return true; } -bool Bind2Backend::superMasterBackend(const string& ip, const DNSName& domain, const vector& nsset, string* nameserver, string* account, DNSBackend** db) +bool Bind2Backend::superMasterBackend(const string& ip, const DNSName& /* domain */, const vector& /* nsset */, string* /* nameserver */, string* account, DNSBackend** db) { // Check whether we have a configfile available. if (getArg("supermaster-config").empty()) @@ -1410,7 +1410,7 @@ BB2DomainInfo Bind2Backend::createDomainEntry(const DNSName& domain, const strin return bbd; } -bool Bind2Backend::createSlaveDomain(const string& ip, const DNSName& domain, const string& nameserver, const string& account) +bool Bind2Backend::createSlaveDomain(const string& ip, const DNSName& domain, const string& /* nameserver */, const string& account) { string filename = getArg("supermaster-destdir") + '/' + domain.toStringNoDot(); diff --git a/modules/geoipbackend/geoipbackend.cc b/modules/geoipbackend/geoipbackend.cc index b5a021dd34..7c57b85b0d 100644 --- a/modules/geoipbackend/geoipbackend.cc +++ b/modules/geoipbackend/geoipbackend.cc @@ -827,12 +827,12 @@ void GeoIPBackend::reload() } } -void GeoIPBackend::rediscover(string* status) +void GeoIPBackend::rediscover(string* /* status */) { reload(); } -bool GeoIPBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool getSerial) +bool GeoIPBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool /* getSerial */) { ReadLock rl(&s_state_lock); @@ -851,7 +851,7 @@ bool GeoIPBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool get return false; } -void GeoIPBackend::getAllDomains(vector* domains, bool getSerial, bool include_disabled) +void GeoIPBackend::getAllDomains(vector* domains, bool /* getSerial */, bool /* include_disabled */) { ReadLock rl(&s_state_lock); @@ -1094,12 +1094,12 @@ bool GeoIPBackend::deactivateDomainKey(const DNSName& name, unsigned int id) return false; } -bool GeoIPBackend::publishDomainKey(const DNSName& name, unsigned int id) +bool GeoIPBackend::publishDomainKey(const DNSName& /* name */, unsigned int /* id */) { return false; } -bool GeoIPBackend::unpublishDomainKey(const DNSName& name, unsigned int id) +bool GeoIPBackend::unpublishDomainKey(const DNSName& /* name */, unsigned int /* id */) { return false; } diff --git a/modules/geoipbackend/geoipbackend.hh b/modules/geoipbackend/geoipbackend.hh index 470da9bdb0..e036ab4f1e 100644 --- a/modules/geoipbackend/geoipbackend.hh +++ b/modules/geoipbackend/geoipbackend.hh @@ -50,10 +50,10 @@ public: ~GeoIPBackend(); void lookup(const QType& qtype, const DNSName& qdomain, int zoneId, DNSPacket* pkt_p = nullptr) override; - bool list(const DNSName& target, int domain_id, bool include_disabled = false) override { return false; } // not supported + bool list(const DNSName& /* target */, int /* domain_id */, bool /* include_disabled */ = false) override { return false; } // not supported bool get(DNSResourceRecord& r) override; void reload() override; - void rediscover(string* status = 0) override; + void rediscover(string* status = nullptr) override; bool getDomainInfo(const DNSName& domain, DomainInfo& di, bool getSerial = true) override; void getAllDomains(vector* domains, bool getSerial, bool include_disabled) override; diff --git a/modules/geoipbackend/geoipinterface-dat.cc b/modules/geoipbackend/geoipinterface-dat.cc index 75b11ccc58..2a3f7596a8 100644 --- a/modules/geoipbackend/geoipinterface-dat.cc +++ b/modules/geoipbackend/geoipinterface-dat.cc @@ -433,7 +433,7 @@ public: bool queryLocationV6(GeoIPNetmask& gl, const string& ip, double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) override + boost::optional& /* alt */, boost::optional& /* prec */) override { if (d_db_type == GEOIP_REGION_EDITION_REV0 || d_db_type == GEOIP_REGION_EDITION_REV1 || d_db_type == GEOIP_CITY_EDITION_REV0_V6 || d_db_type == GEOIP_CITY_EDITION_REV1_V6) { std::unique_ptr gir(GeoIP_record_by_addr_v6(d_gi.get(), ip.c_str())); @@ -449,7 +449,7 @@ public: bool queryLocation(GeoIPNetmask& gl, const string& ip, double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) override + boost::optional& /* alt */, boost::optional& /* prec */) override { if (d_db_type == GEOIP_REGION_EDITION_REV0 || d_db_type == GEOIP_REGION_EDITION_REV1 || d_db_type == GEOIP_CITY_EDITION_REV0 || d_db_type == GEOIP_CITY_EDITION_REV1) { std::unique_ptr gir(GeoIP_record_by_addr(d_gi.get(), ip.c_str())); diff --git a/modules/geoipbackend/geoipinterface-mmdb.cc b/modules/geoipbackend/geoipinterface-mmdb.cc index 969d5abc52..fae7c44d28 100644 --- a/modules/geoipbackend/geoipinterface-mmdb.cc +++ b/modules/geoipbackend/geoipinterface-mmdb.cc @@ -208,7 +208,7 @@ public: bool queryLocation(GeoIPNetmask& gl, const string& ip, double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) override + boost::optional& /* alt */, boost::optional& prec) override { MMDB_entry_data_s data; MMDB_lookup_result_s res; @@ -228,7 +228,7 @@ public: bool queryLocationV6(GeoIPNetmask& gl, const string& ip, double& latitude, double& longitude, - boost::optional& alt, boost::optional& prec) override + boost::optional& /* alt */, boost::optional& prec) override { MMDB_entry_data_s data; MMDB_lookup_result_s res; diff --git a/modules/gmysqlbackend/smysql.cc b/modules/gmysqlbackend/smysql.cc index a25f8f4c2c..db8e6c2f32 100644 --- a/modules/gmysqlbackend/smysql.cc +++ b/modules/gmysqlbackend/smysql.cc @@ -88,7 +88,7 @@ public: } } - SSqlStatement* bind(const string& name, bool value) + SSqlStatement* bind(const string& /* name */, bool value) { prepareStatement(); if (d_paridx >= d_parnum) { @@ -109,7 +109,7 @@ public: { return bind(name, (unsigned long)value); } - SSqlStatement* bind(const string& name, long value) + SSqlStatement* bind(const string& /* name */, long value) { prepareStatement(); if (d_paridx >= d_parnum) { @@ -122,7 +122,7 @@ public: d_paridx++; return this; } - SSqlStatement* bind(const string& name, unsigned long value) + SSqlStatement* bind(const string& /* name */, unsigned long value) { prepareStatement(); if (d_paridx >= d_parnum) { @@ -136,7 +136,7 @@ public: d_paridx++; return this; } - SSqlStatement* bind(const string& name, long long value) + SSqlStatement* bind(const string& /* name */, long long value) { prepareStatement(); if (d_paridx >= d_parnum) { @@ -149,7 +149,7 @@ public: d_paridx++; return this; } - SSqlStatement* bind(const string& name, unsigned long long value) + SSqlStatement* bind(const string& /* name */, unsigned long long value) { prepareStatement(); if (d_paridx >= d_parnum) { @@ -163,7 +163,7 @@ public: d_paridx++; return this; } - SSqlStatement* bind(const string& name, const std::string& value) + SSqlStatement* bind(const string& /* name */, const std::string& value) { prepareStatement(); if (d_paridx >= d_parnum) { @@ -180,7 +180,7 @@ public: d_paridx++; return this; } - SSqlStatement* bindNull(const string& name) + SSqlStatement* bindNull(const string& /* name */) { prepareStatement(); if (d_paridx >= d_parnum) { diff --git a/modules/godbcbackend/sodbc.cc b/modules/godbcbackend/sodbc.cc index 3db686fcca..3d21bb70aa 100644 --- a/modules/godbcbackend/sodbc.cc +++ b/modules/godbcbackend/sodbc.cc @@ -89,7 +89,7 @@ public: vector d_req_bind; - SSqlStatement* bind(const string& name, ODBCParam& p) + SSqlStatement* bind(const string& /* name */, ODBCParam& p) { prepareStatement(); d_req_bind.push_back(p); diff --git a/modules/gpgsqlbackend/spgsql.cc b/modules/gpgsqlbackend/spgsql.cc index 823d38dd3e..9b19b0ce2a 100644 --- a/modules/gpgsqlbackend/spgsql.cc +++ b/modules/gpgsqlbackend/spgsql.cc @@ -51,7 +51,7 @@ public: SSqlStatement* bind(const string& name, unsigned long value) { return bind(name, std::to_string(value)); } SSqlStatement* bind(const string& name, long long value) { return bind(name, std::to_string(value)); } SSqlStatement* bind(const string& name, unsigned long long value) { return bind(name, std::to_string(value)); } - SSqlStatement* bind(const string& name, const std::string& value) + SSqlStatement* bind(const string& /* name */, const std::string& value) { prepareStatement(); allocate(); @@ -66,7 +66,7 @@ public: d_paridx++; return this; } - SSqlStatement* bindNull(const string& name) + SSqlStatement* bindNull(const string& /* name */) { prepareStatement(); d_paridx++; diff --git a/modules/ldapbackend/ldapauthenticator.cc b/modules/ldapbackend/ldapauthenticator.cc index 9b98f3ccc0..611b4391fb 100644 --- a/modules/ldapbackend/ldapauthenticator.cc +++ b/modules/ldapbackend/ldapauthenticator.cc @@ -74,12 +74,12 @@ void LdapSimpleAuthenticator::fillLastError(LDAP* conn, int code) * ****************************/ -static int ldapGssapiAuthenticatorSaslInteractCallback(LDAP* conn, unsigned flags, void* defaults, void* in) +static int ldapGssapiAuthenticatorSaslInteractCallback(LDAP* /* conn */, unsigned /* flags */, void* /* defaults */, void* /* in */) { return LDAP_SUCCESS; } -LdapGssapiAuthenticator::LdapGssapiAuthenticator(const std::string& kt, const std::string& ccache, int tmout) : +LdapGssapiAuthenticator::LdapGssapiAuthenticator(const std::string& kt, const std::string& ccache, int /* tmout */) : d_logPrefix("[LDAP GSSAPI] "), d_keytabFile(kt), d_cCacheFile(ccache) { krb5_error_code code; diff --git a/modules/ldapbackend/native.cc b/modules/ldapbackend/native.cc index 51b2e044b6..82ddebf060 100644 --- a/modules/ldapbackend/native.cc +++ b/modules/ldapbackend/native.cc @@ -24,7 +24,7 @@ #include "ldapbackend.hh" #include -bool LdapBackend::list(const DNSName& target, int domain_id, bool include_disabled) +bool LdapBackend::list(const DNSName& target, int domain_id, bool /* include_disabled */) { try { d_in_list = true; @@ -57,7 +57,7 @@ bool LdapBackend::list(const DNSName& target, int domain_id, bool include_disabl return false; } -bool LdapBackend::list_simple(const DNSName& target, int domain_id) +bool LdapBackend::list_simple(const DNSName& target, int /* domain_id */) { string dn; string filter; @@ -136,7 +136,7 @@ void LdapBackend::lookup(const QType& qtype, const DNSName& qname, int zoneid, D } } -void LdapBackend::lookup_simple(const QType& qtype, const DNSName& qname, DNSPacket* dnspkt, int zoneid) +void LdapBackend::lookup_simple(const QType& qtype, const DNSName& qname, DNSPacket* /* dnspkt */, int /* zoneid */) { string filter, attr, qesc; const char** attributes = ldap_attrany + 1; // skip associatedDomain @@ -158,7 +158,7 @@ void LdapBackend::lookup_simple(const QType& qtype, const DNSName& qname, DNSPac d_search = d_pldap->search(getArg("basedn"), LDAP_SCOPE_SUBTREE, filter, attributes); } -void LdapBackend::lookup_strict(const QType& qtype, const DNSName& qname, DNSPacket* dnspkt, int zoneid) +void LdapBackend::lookup_strict(const QType& qtype, const DNSName& qname, DNSPacket* /* dnspkt */, int /* zoneid */) { int len; vector parts; @@ -200,7 +200,7 @@ void LdapBackend::lookup_strict(const QType& qtype, const DNSName& qname, DNSPac d_search = d_pldap->search(getArg("basedn"), LDAP_SCOPE_SUBTREE, filter, attributes); } -void LdapBackend::lookup_tree(const QType& qtype, const DNSName& qname, DNSPacket* dnspkt, int zoneid) +void LdapBackend::lookup_tree(const QType& qtype, const DNSName& qname, DNSPacket* /* dnspkt */, int /* zoneid */) { string filter, attr, qesc, dn; const char** attributes = ldap_attrany + 1; // skip associatedDomain @@ -318,7 +318,7 @@ bool LdapBackend::get(DNSResourceRecord& rr) return true; } -bool LdapBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool getSerial) +bool LdapBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool /* getSerial */) { string filter; SOAData sd; diff --git a/modules/ldapbackend/powerldap.cc b/modules/ldapbackend/powerldap.cc index fc5af43c0c..75a82461db 100644 --- a/modules/ldapbackend/powerldap.cc +++ b/modules/ldapbackend/powerldap.cc @@ -42,7 +42,7 @@ PowerLDAP::SearchResult::~SearchResult() // not much we can do now } -bool PowerLDAP::SearchResult::getNext(PowerLDAP::sentry_t& entry, bool dn, int timeout) +bool PowerLDAP::SearchResult::getNext(PowerLDAP::sentry_t& entry, bool dn, int /* timeout */) { int i; char* attr; @@ -214,7 +214,7 @@ void PowerLDAP::bind(LdapAuthenticator* authenticator) throw LDAPException("Failed to bind to LDAP server: " + authenticator->getError()); } -void PowerLDAP::bind(const string& ldapbinddn, const string& ldapsecret, int method) +void PowerLDAP::bind(const string& ldapbinddn, const string& ldapsecret, int /* method */) { int msgid; diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index 086200f50b..403db62e64 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -155,7 +155,7 @@ namespace serialization { template - void save(Archive& ar, const DNSName& g, const unsigned int version) + void save(Archive& ar, const DNSName& g, const unsigned int /* version */) { if (g.empty()) { ar& std::string(); @@ -166,7 +166,7 @@ namespace serialization } template - void load(Archive& ar, DNSName& g, const unsigned int version) + void load(Archive& ar, DNSName& g, const unsigned int /* version */) { string tmp; ar& tmp; @@ -179,13 +179,13 @@ namespace serialization } template - void save(Archive& ar, const QType& g, const unsigned int version) + void save(Archive& ar, const QType& g, const unsigned int /* version */) { ar& g.getCode(); } template - void load(Archive& ar, QType& g, const unsigned int version) + void load(Archive& ar, QType& g, const unsigned int /* version */) { uint16_t tmp; ar& tmp; @@ -193,7 +193,7 @@ namespace serialization } template - void save(Archive& ar, const DomainInfo& g, const unsigned int version) + void save(Archive& ar, const DomainInfo& g, const unsigned int /* version */) { ar& g.zone; ar& g.last_check; @@ -227,13 +227,13 @@ namespace serialization } template - void serialize(Archive& ar, LMDBBackend::DomainMeta& g, const unsigned int version) + void serialize(Archive& ar, LMDBBackend::DomainMeta& g, const unsigned int /* version */) { ar& g.domain& g.key& g.value; } template - void save(Archive& ar, const LMDBBackend::KeyDataDB& g, const unsigned int version) + void save(Archive& ar, const LMDBBackend::KeyDataDB& g, const unsigned int /* version */) { ar& g.domain& g.content& g.flags& g.active& g.published; } @@ -251,7 +251,7 @@ namespace serialization } template - void serialize(Archive& ar, TSIGKey& g, const unsigned int version) + void serialize(Archive& ar, TSIGKey& g, const unsigned int /* version */) { ar& g.name; ar& g.algorithm; // this is the ordername @@ -725,7 +725,7 @@ bool LMDBBackend::deleteDomain(const DNSName& domain) return true; } -bool LMDBBackend::list(const DNSName& target, int id, bool include_disabled) +bool LMDBBackend::list(const DNSName& target, int /* id */, bool include_disabled) { d_includedisabled = include_disabled; @@ -761,7 +761,7 @@ bool LMDBBackend::list(const DNSName& target, int id, bool include_disabled) return true; } -void LMDBBackend::lookup(const QType& type, const DNSName& qdomain, int zoneId, DNSPacket* p) +void LMDBBackend::lookup(const QType& type, const DNSName& qdomain, int zoneId, DNSPacket* /* p */) { if (d_dolog) { g_log << Logger::Warning << "Got lookup for " << qdomain << "|" << type.toString() << " in zone " << zoneId << endl; @@ -1022,7 +1022,7 @@ bool LMDBBackend::createDomain(const DNSName& domain, const DomainInfo::DomainKi return true; } -void LMDBBackend::getAllDomains(vector* domains, bool doSerial, bool include_disabled) +void LMDBBackend::getAllDomains(vector* domains, bool /* doSerial */, bool include_disabled) { domains->clear(); auto txn = d_tdomains->getROTransaction(); diff --git a/modules/lua2backend/lua2api2.hh b/modules/lua2backend/lua2api2.hh index aaedf1a9d6..1f11a9afd5 100644 --- a/modules/lua2backend/lua2api2.hh +++ b/modules/lua2backend/lua2api2.hh @@ -176,7 +176,7 @@ public: g_log << Logger::Debug << "[" << getPrefix() << "] Got empty result" << endl; } - bool list(const DNSName& target, int domain_id, bool include_disabled = false) override + bool list(const DNSName& target, int domain_id, bool /* include_disabled */ = false) override { if (f_list == nullptr) { g_log << Logger::Error << "[" << getPrefix() << "] dns_list missing - cannot do AXFR" << endl; @@ -272,7 +272,7 @@ public: logResult("zone=" << di.zone << ",serial=" << di.serial << ",kind=" << di.getKindString()); } - bool getDomainInfo(const DNSName& domain, DomainInfo& di, bool getSerial = true) override + bool getDomainInfo(const DNSName& domain, DomainInfo& di, bool /* getSerial */ = true) override { if (f_get_domaininfo == nullptr) { // use getAuth instead @@ -298,7 +298,7 @@ public: return true; } - void getAllDomains(vector* domains, bool getSerial, bool include_disabled) override + void getAllDomains(vector* domains, bool /* getSerial */, bool /* include_disabled */) override { if (f_get_all_domains == nullptr) return; diff --git a/modules/pipebackend/coprocess.cc b/modules/pipebackend/coprocess.cc index fbbb6da376..91a63fcf58 100644 --- a/modules/pipebackend/coprocess.cc +++ b/modules/pipebackend/coprocess.cc @@ -218,7 +218,7 @@ void CoProcess::sendReceive(const string& snd, string& rcv) receive(rcv); } -UnixRemote::UnixRemote(const string& path, int timeout) +UnixRemote::UnixRemote(const string& path, int /* timeout */) { d_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (d_fd < 0) diff --git a/modules/pipebackend/pipebackend.cc b/modules/pipebackend/pipebackend.cc index fa94ea2f75..8e51a3fd47 100644 --- a/modules/pipebackend/pipebackend.cc +++ b/modules/pipebackend/pipebackend.cc @@ -197,7 +197,7 @@ void PipeBackend::lookup(const QType& qtype, const DNSName& qname, int zoneId, D d_qname = qname; } -bool PipeBackend::list(const DNSName& target, int inZoneId, bool include_disabled) +bool PipeBackend::list(const DNSName& target, int inZoneId, bool /* include_disabled */) { try { launch(); diff --git a/modules/remotebackend/remotebackend.cc b/modules/remotebackend/remotebackend.cc index 144fb25ba3..19e1ec99a6 100644 --- a/modules/remotebackend/remotebackend.cc +++ b/modules/remotebackend/remotebackend.cc @@ -600,7 +600,7 @@ void RemoteBackend::parseDomainInfo(const Json& obj, DomainInfo& di) di.backend = this; } -bool RemoteBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool getSerial) +bool RemoteBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool /* getSerial */) { if (domain.empty()) return false; @@ -705,7 +705,7 @@ bool RemoteBackend::replaceRRSet(uint32_t domain_id, const DNSName& qname, const return true; } -bool RemoteBackend::feedRecord(const DNSResourceRecord& rr, const DNSName& ordername, bool ordernameIsNSEC3) +bool RemoteBackend::feedRecord(const DNSResourceRecord& rr, const DNSName& ordername, bool /* ordernameIsNSEC3 */) { Json query = Json::object{ {"method", "feedRecord"}, @@ -852,13 +852,13 @@ bool RemoteBackend::searchRecords(const string& pattern, int maxResults, vector< return true; } -bool RemoteBackend::searchComments(const string& pattern, int maxResults, vector& result) +bool RemoteBackend::searchComments(const string& /* pattern */, int /* maxResults */, vector& /* result */) { // FIXME: Implement Comment API return false; } -void RemoteBackend::getAllDomains(vector* domains, bool getSerial, bool include_disabled) +void RemoteBackend::getAllDomains(vector* domains, bool /* getSerial */, bool include_disabled) { Json query = Json::object{ {"method", "getAllDomains"}, @@ -878,7 +878,7 @@ void RemoteBackend::getAllDomains(vector* domains, bool getSerial, b } } -void RemoteBackend::getUpdatedMasters(vector& domains, std::unordered_set& catalogs, CatalogHashMap& catalogHashes) +void RemoteBackend::getUpdatedMasters(vector& domains, std::unordered_set& /* catalogs */, CatalogHashMap& /* catalogHashes */) { Json query = Json::object{ {"method", "getUpdatedMasters"}, diff --git a/modules/tinydnsbackend/tinydnsbackend.cc b/modules/tinydnsbackend/tinydnsbackend.cc index c1b02a1ec1..b76f20ed1c 100644 --- a/modules/tinydnsbackend/tinydnsbackend.cc +++ b/modules/tinydnsbackend/tinydnsbackend.cc @@ -88,7 +88,7 @@ TinyDNSBackend::TinyDNSBackend(const string& suffix) d_isWildcardQuery = false; } -void TinyDNSBackend::getUpdatedMasters(vector& retDomains, std::unordered_set& catalogs, CatalogHashMap& catalogHashes) +void TinyDNSBackend::getUpdatedMasters(vector& retDomains, std::unordered_set& /* catalogs */, CatalogHashMap& /* catalogHashes */) { auto domainInfo = s_domainInfo.lock(); //TODO: We could actually lock less if we do it per suffix. if (!domainInfo->count(d_suffix)) { @@ -151,7 +151,7 @@ void TinyDNSBackend::setNotified(uint32_t id, uint32_t serial) (*domainInfo)[d_suffix] = *domains; } -void TinyDNSBackend::getAllDomains(vector* domains, bool getSerial, bool include_disabled) +void TinyDNSBackend::getAllDomains(vector* domains, bool getSerial, bool /* include_disabled */) { d_isAxfr = true; d_isGetDomains = true; @@ -195,7 +195,7 @@ void TinyDNSBackend::getAllDomains(vector* domains, bool getSerial, } } -bool TinyDNSBackend::list(const DNSName& target, int domain_id, bool include_disabled) +bool TinyDNSBackend::list(const DNSName& target, int /* domain_id */, bool /* include_disabled */) { d_isAxfr = true; d_isGetDomains = false; @@ -211,7 +211,7 @@ bool TinyDNSBackend::list(const DNSName& target, int domain_id, bool include_dis return d_cdbReader->searchSuffix(key); } -void TinyDNSBackend::lookup(const QType& qtype, const DNSName& qdomain, int zoneId, DNSPacket* pkt_p) +void TinyDNSBackend::lookup(const QType& qtype, const DNSName& qdomain, int /* zoneId */, DNSPacket* pkt_p) { d_isAxfr = false; d_isGetDomains = false; diff --git a/pdns/auth-main.cc b/pdns/auth-main.cc index e4e27e9f31..0282498018 100644 --- a/pdns/auth-main.cc +++ b/pdns/auth-main.cc @@ -334,7 +334,7 @@ static void declareArguments() } static time_t s_start = time(nullptr); -static uint64_t uptimeOfProcess(const std::string& str) +static uint64_t uptimeOfProcess(const std::string& /* str */) { return time(nullptr) - s_start; } @@ -351,12 +351,12 @@ static uint64_t getSysUserTimeMsec(const std::string& str) return (ru.ru_utime.tv_sec * 1000ULL + ru.ru_utime.tv_usec / 1000); } -static uint64_t getTCPConnectionCount(const std::string& str) +static uint64_t getTCPConnectionCount(const std::string& /* str */) { return s_tcpNameserver->numTCPConnections(); } -static uint64_t getQCount(const std::string& str) +static uint64_t getQCount(const std::string& /* str */) try { int totcount = 0; for (const auto& d : s_distributors) { @@ -375,27 +375,27 @@ catch (PDNSException& e) { return 0; } -static uint64_t getLatency(const std::string& str) +static uint64_t getLatency(const std::string& /* str */) { return round(avg_latency); } -static uint64_t getReceiveLatency(const std::string& str) +static uint64_t getReceiveLatency(const std::string& /* str */) { return round(receive_latency); } -static uint64_t getCacheLatency(const std::string& str) +static uint64_t getCacheLatency(const std::string& /* str */) { return round(cache_latency); } -static uint64_t getBackendLatency(const std::string& str) +static uint64_t getBackendLatency(const std::string& /* str */) { return round(backend_latency); } -static uint64_t getSendLatency(const std::string& str) +static uint64_t getSendLatency(const std::string& /* str */) { return round(send_latency); } @@ -925,7 +925,7 @@ static void daemonize() } static int cpid; -static void takedown(int i) +static void takedown(int /* i */) { if (cpid) { g_log << Logger::Error << "Guardian is killed, taking down children with us" << endl; @@ -963,7 +963,7 @@ static FILE* g_fp; static std::mutex g_guardian_lock; // The next two methods are not in dynhandler.cc because they use a few items declared in this file. -static string DLCycleHandler(const vector& parts, pid_t ppid) +static string DLCycleHandler(const vector& /* parts */, pid_t /* ppid */) { kill(cpid, SIGKILL); // why? kill(cpid, SIGKILL); // why? @@ -971,7 +971,7 @@ static string DLCycleHandler(const vector& parts, pid_t ppid) return "ok"; } -static string DLRestHandler(const vector& parts, pid_t ppid) +static string DLRestHandler(const vector& parts, pid_t /* ppid */) { string line; diff --git a/pdns/backends/gsql/gsqlbackend.cc b/pdns/backends/gsql/gsqlbackend.cc index b146c58036..ead6243d68 100644 --- a/pdns/backends/gsql/gsqlbackend.cc +++ b/pdns/backends/gsql/gsqlbackend.cc @@ -1326,7 +1326,7 @@ bool GSQLBackend::setDomainMetadata(const DNSName& name, const std::string& kind return true; } -void GSQLBackend::lookup(const QType &qtype,const DNSName &qname, int domain_id, DNSPacket *pkt_p) +void GSQLBackend::lookup(const QType& qtype, const DNSName& qname, int domain_id, DNSPacket* /* pkt_p */) { try { reconnectIfNeeded(); @@ -1790,7 +1790,7 @@ bool GSQLBackend::replaceRRSet(uint32_t domain_id, const DNSName& qname, const Q return true; } -bool GSQLBackend::feedRecord(const DNSResourceRecord &r, const DNSName &ordername, bool ordernameIsNSEC3) +bool GSQLBackend::feedRecord(const DNSResourceRecord& r, const DNSName& ordername, bool /* ordernameIsNSEC3 */) { int prio=0; string content(r.content); @@ -1856,7 +1856,7 @@ bool GSQLBackend::feedEnts(int domain_id, map& nonterm) return true; } -bool GSQLBackend::feedEnts3(int domain_id, const DNSName &domain, map &nonterm, const NSEC3PARAMRecordContent& ns3prc, bool narrow) +bool GSQLBackend::feedEnts3(int domain_id, const DNSName& /* domain */, map& nonterm, const NSEC3PARAMRecordContent& ns3prc, bool narrow) { if(!d_dnssecQueries) return false; diff --git a/pdns/backends/gsql/ssql.hh b/pdns/backends/gsql/ssql.hh index 6957920826..c532572e30 100644 --- a/pdns/backends/gsql/ssql.hh +++ b/pdns/backends/gsql/ssql.hh @@ -81,7 +81,7 @@ public: virtual void startTransaction()=0; virtual void rollback()=0; virtual void commit()=0; - virtual void setLog(bool state){} + virtual void setLog(bool /* state */){} virtual bool isConnectionUsable() { return true; diff --git a/pdns/cachecleaner.hh b/pdns/cachecleaner.hh index 1fe5a91193..5f8ee29521 100644 --- a/pdns/cachecleaner.hh +++ b/pdns/cachecleaner.hh @@ -31,7 +31,7 @@ // the ritual is that the oldest entries are in *front* of the sequence collection, so on a hit, move an item to the end // and optionally, on a miss, move it to the beginning template -void pruneCollection(C& container, T& collection, size_t maxCached, size_t scanFraction = 1000) +void pruneCollection(C& /* container */, T& collection, size_t maxCached, size_t scanFraction = 1000) { const time_t now = time(nullptr); size_t toTrim = 0; diff --git a/pdns/credentials.cc b/pdns/credentials.cc index b086788a5f..137f1b7f67 100644 --- a/pdns/credentials.cc +++ b/pdns/credentials.cc @@ -444,7 +444,7 @@ SensitiveData CredentialsHolder::readFromTerminal() struct sigaction sa; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - sa.sa_handler = [](int s) {}; + sa.sa_handler = [](int /* s */) {}; sigaction(SIGALRM, &sa, &signals[SIGALRM]); sigaction(SIGHUP, &sa, &signals[SIGHUP]); sigaction(SIGINT, &sa, &signals[SIGINT]); diff --git a/pdns/dbdnsseckeeper.cc b/pdns/dbdnsseckeeper.cc index ab24a07c0e..30c201290f 100644 --- a/pdns/dbdnsseckeeper.cc +++ b/pdns/dbdnsseckeeper.cc @@ -668,7 +668,7 @@ bool DNSSECKeeper::TSIGGrantsAccess(const DNSName& zone, const DNSName& keyname) return false; } -bool DNSSECKeeper::getTSIGForAccess(const DNSName& zone, const ComboAddress& master, DNSName* keyname) +bool DNSSECKeeper::getTSIGForAccess(const DNSName& zone, const ComboAddress& /* master */, DNSName* keyname) { vector keynames; d_keymetadb->getDomainMetadata(zone, "AXFR-MASTER-TSIG", keynames); @@ -682,7 +682,7 @@ bool DNSSECKeeper::getTSIGForAccess(const DNSName& zone, const ComboAddress& mas return false; } -bool DNSSECKeeper::unSecureZone(const DNSName& zone, string& error, string& info) { +bool DNSSECKeeper::unSecureZone(const DNSName& zone, string& error, string& /* info */) { // Not calling isSecuredZone(), as it will return false for zones with zero // active keys. DNSSECKeeper::keyset_t keyset=getKeys(zone); diff --git a/pdns/dnsbackend.cc b/pdns/dnsbackend.cc index f0ae76a896..bd7645601b 100644 --- a/pdns/dnsbackend.cc +++ b/pdns/dnsbackend.cc @@ -304,7 +304,7 @@ bool DNSBackend::getBeforeAndAfterNames(uint32_t id, const DNSName& zonename, co return ret; } -void DNSBackend::getAllDomains(vector* domains, bool getSerial, bool include_disabled) +void DNSBackend::getAllDomains(vector* /* domains */, bool /* getSerial */, bool /* include_disabled */) { if (g_zoneCache.isEnabled()) { g_log << Logger::Error << "One of the backends does not support zone caching. Put zone-cache-refresh-interval=0 in the config file to disable this cache." << endl; diff --git a/pdns/dnsbackend.hh b/pdns/dnsbackend.hh index cc3ed3e360..4adad31440 100644 --- a/pdns/dnsbackend.hh +++ b/pdns/dnsbackend.hh @@ -173,12 +173,12 @@ public: //! fills the soadata struct with the SOA details. Returns false if there is no SOA. virtual bool getSOA(const DNSName &name, SOAData &soadata); - virtual bool replaceRRSet(uint32_t domain_id, const DNSName& qname, const QType& qt, const vector& rrset) + virtual bool replaceRRSet(uint32_t /* domain_id */, const DNSName& /* qname */, const QType& /* qt */, const vector& /* rrset */) { return false; } - virtual bool listSubZone(const DNSName &zone, int domain_id) + virtual bool listSubZone(const DNSName& /* zone */, int /* domain_id */) { return false; } @@ -187,8 +187,8 @@ public: bool isDnssecDomainMetadata (const string& name) { return (name == "PRESIGNED" || name == "NSEC3PARAM" || name == "NSEC3NARROW"); } - virtual bool getAllDomainMetadata(const DNSName& name, std::map >& meta) { return false; }; - virtual bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector& meta) { return false; } + virtual bool getAllDomainMetadata(const DNSName& /* name */, std::map>& /* meta */) { return false; }; + virtual bool getDomainMetadata(const DNSName& /* name */, const std::string& /* kind */, std::vector& /* meta */) { return false; } virtual bool getDomainMetadataOne(const DNSName& name, const std::string& kind, std::string& value) { std::vector meta; @@ -201,7 +201,7 @@ public: return false; } - virtual bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector& meta) {return false;} + virtual bool setDomainMetadata(const DNSName& /* name */, const std::string& /* kind */, const std::vector& /* meta */) { return false; } virtual bool setDomainMetadataOne(const DNSName& name, const std::string& kind, const std::string& value) { const std::vector meta(1, value); @@ -211,7 +211,7 @@ public: virtual void getAllDomains(vector* domains, bool getSerial, bool include_disabled); /** Determines if we are authoritative for a zone, and at what level */ - virtual bool getAuth(const DNSName &target, SOAData *sd); + virtual bool getAuth(const DNSName& target, SOAData* /* sd */); struct KeyData { std::string content; @@ -221,34 +221,34 @@ public: bool published; }; - virtual bool getDomainKeys(const DNSName& name, std::vector& keys) { return false;} - virtual bool removeDomainKey(const DNSName& name, unsigned int id) { return false; } - virtual bool addDomainKey(const DNSName& name, const KeyData& key, int64_t& id){ return false; } - virtual bool activateDomainKey(const DNSName& name, unsigned int id) { return false; } - virtual bool deactivateDomainKey(const DNSName& name, unsigned int id) { return false; } - virtual bool publishDomainKey(const DNSName& name, unsigned int id) { return false; } - virtual bool unpublishDomainKey(const DNSName& name, unsigned int id) { return false; } + virtual bool getDomainKeys(const DNSName& /* name */, std::vector& /* keys */) { return false; } + virtual bool removeDomainKey(const DNSName& /* name */, unsigned int /* id */) { return false; } + virtual bool addDomainKey(const DNSName& /* name */, const KeyData& /* key */, int64_t& /* id */) { return false; } + virtual bool activateDomainKey(const DNSName& /* name */, unsigned int /* id */) { return false; } + virtual bool deactivateDomainKey(const DNSName& /* name */, unsigned int /* id */) { return false; } + virtual bool publishDomainKey(const DNSName& /* name */, unsigned int /* id */) { return false; } + virtual bool unpublishDomainKey(const DNSName& /* name */, unsigned int /* id */) { return false; } - virtual bool setTSIGKey(const DNSName& name, const DNSName& algorithm, const string& content) { return false; } - virtual bool getTSIGKey(const DNSName& name, DNSName& algorithm, string& content) { return false; } - virtual bool getTSIGKeys(std::vector& keys) { return false; } - virtual bool deleteTSIGKey(const DNSName& name) { return false; } + virtual bool setTSIGKey(const DNSName& /* name */, const DNSName& /* algorithm */, const string& /* content */) { return false; } + virtual bool getTSIGKey(const DNSName& /* name */, DNSName& /* algorithm */, string& /* content */) { return false; } + virtual bool getTSIGKeys(std::vector& /* keys */) { return false; } + virtual bool deleteTSIGKey(const DNSName& /* name */) { return false; } - virtual bool getBeforeAndAfterNamesAbsolute(uint32_t id, const DNSName& qname, DNSName& unhashed, DNSName& before, DNSName& after) + virtual bool getBeforeAndAfterNamesAbsolute(uint32_t /* id */, const DNSName& /* qname */, DNSName& /* unhashed */, DNSName& /* before */, DNSName& /* after */) { - std::cerr<<"Default beforeAndAfterAbsolute called!"<& insert, set& erase, bool remove) + virtual bool updateEmptyNonTerminals(uint32_t /* domain_id */, set& /* insert */, set& /* erase */, bool /* remove */) { return false; } @@ -261,28 +261,28 @@ public: // end DNSSEC // comments support - virtual bool listComments(uint32_t domain_id) + virtual bool listComments(uint32_t /* domain_id */) { return false; // unsupported by this backend } - virtual bool getComment(Comment& comment) + virtual bool getComment(Comment& /* comment */) { return false; } - virtual void feedComment(const Comment& comment) + virtual void feedComment(const Comment& /* comment */) { } - virtual bool replaceComments(const uint32_t domain_id, const DNSName& qname, const QType& qt, const vector& comments) + virtual bool replaceComments(const uint32_t /* domain_id */, const DNSName& /* qname */, const QType& /* qt */, const vector& /* comments */) { return false; } //! returns true if master ip is master for domain name. //! starts the transaction for updating domain qname (FIXME: what is id?) - virtual bool startTransaction(const DNSName &qname, int id=-1) + virtual bool startTransaction(const DNSName& /* qname */, int /* id */ = -1) { return false; } @@ -308,36 +308,36 @@ public: { } - virtual void rediscover(string* status=0) + virtual void rediscover(string* /* status */ = nullptr) { } //! feeds a record to a zone, needs a call to startTransaction first - virtual bool feedRecord(const DNSResourceRecord &rr, const DNSName &ordername, bool ordernameIsNSEC3=false) + virtual bool feedRecord(const DNSResourceRecord& /* rr */, const DNSName& /* ordername */, bool /* ordernameIsNSEC3 */ = false) { return false; // no problem! } - virtual bool feedEnts(int domain_id, map &nonterm) + virtual bool feedEnts(int /* domain_id */, map& /* nonterm */) { return false; } - virtual bool feedEnts3(int domain_id, const DNSName &domain, map &nonterm, const NSEC3PARAMRecordContent& ns3prc, bool narrow) + virtual bool feedEnts3(int /* domain_id */, const DNSName& /* domain */, map& /* nonterm */, const NSEC3PARAMRecordContent& /* ns3prc */, bool /* narrow */) { return false; } //! if this returns true, DomainInfo di contains information about the domain - virtual bool getDomainInfo(const DNSName &domain, DomainInfo &di, bool getSerial=true) + virtual bool getDomainInfo(const DNSName& /* domain */, DomainInfo& /* di */, bool /* getSerial */ = true) { return false; } //! slave capable backends should return a list of slaves that should be rechecked for staleness - virtual void getUnfreshSlaveInfos(vector* domains) + virtual void getUnfreshSlaveInfos(vector* /* domains */) { } //! get a list of IP addresses that should also be notified for a domain - virtual void alsoNotifies(const DNSName &domain, set *ips) + virtual void alsoNotifies(const DNSName& domain, set* ips) { std::vector meta; getDomainMetadata(domain, "ALSO-NOTIFY", meta); @@ -345,57 +345,57 @@ public: } //! get list of domains that have been changed since their last notification to slaves - virtual void getUpdatedMasters(vector& domains, std::unordered_set& catalogs, CatalogHashMap& catalogHashes) + virtual void getUpdatedMasters(vector& /* domains */, std::unordered_set& /* catalogs */, CatalogHashMap& /* catalogHashes */) { } //! get list of all members in a catalog - virtual bool getCatalogMembers(const DNSName& catalog, vector& members, CatalogInfo::CatalogType type) + virtual bool getCatalogMembers(const DNSName& /* catalog */, vector& /* members */, CatalogInfo::CatalogType /* type */) { return false; } //! Called by PowerDNS to inform a backend that a domain need to be checked for freshness - virtual void setStale(uint32_t domain_id) + virtual void setStale(uint32_t /* domain_id */) { } //! Called by PowerDNS to inform a backend that a domain has been checked for freshness - virtual void setFresh(uint32_t domain_id) + virtual void setFresh(uint32_t /* domain_id */) { } //! Called by PowerDNS to inform a backend that the changes in the domain have been reported to slaves - virtual void setNotified(uint32_t id, uint32_t serial) + virtual void setNotified(uint32_t /* id */, uint32_t /* serial */) { } //! Called when the Master list of a domain should be changed - virtual bool setMasters(const DNSName &domain, const vector &masters) + virtual bool setMasters(const DNSName& /* domain */, const vector& /* masters */) { return false; } //! Called when the Kind of a domain should be changed (master -> native and similar) - virtual bool setKind(const DNSName &domain, const DomainInfo::DomainKind kind) + virtual bool setKind(const DNSName& /* domain */, const DomainInfo::DomainKind /* kind */) { return false; } //! Called when the options of a domain should be changed - virtual bool setOptions(const DNSName& domain, const string& options) + virtual bool setOptions(const DNSName& /* domain */, const string& /* options */) { return false; } //! Called when the catalog of a domain should be changed - virtual bool setCatalog(const DNSName& domain, const DNSName& catalog) + virtual bool setCatalog(const DNSName& /* domain */, const DNSName& /* catalog */) { return false; } //! Called when the Account of a domain should be changed - virtual bool setAccount(const DNSName &domain, const string &account) + virtual bool setAccount(const DNSName& /* domain */, const string& /* account */) { return false; } @@ -404,60 +404,60 @@ public: void setArgPrefix(const string &prefix); //! Add an entry for a super master - virtual bool superMasterAdd(const struct AutoPrimary& primary) + virtual bool superMasterAdd(const struct AutoPrimary& /* primary */) { - return false; + return false; } //! Remove an entry for a super master - virtual bool autoPrimaryRemove(const struct AutoPrimary& primary) + virtual bool autoPrimaryRemove(const struct AutoPrimary& /* primary */) { return false; } //! List all SuperMasters, returns false if feature not supported. - virtual bool autoPrimariesList(std::vector& primaries) + virtual bool autoPrimariesList(std::vector& /* primaries */) { return false; } //! determine if ip is a supermaster or a domain - virtual bool superMasterBackend(const string &ip, const DNSName &domain, const vector&nsset, string *nameserver, string *account, DNSBackend **db) + virtual bool superMasterBackend(const string& /* ip */, const DNSName& /* domain */, const vector& /* nsset */, string* /* nameserver */, string* /* account */, DNSBackend** /* db */) { return false; } //! called by PowerDNS to create a new domain - virtual bool createDomain(const DNSName& domain, const DomainInfo::DomainKind kind, const vector& masters, const string& account) + virtual bool createDomain(const DNSName& /* domain */, const DomainInfo::DomainKind /* kind */, const vector& /* masters */, const string& /* account */) { return false; } //! called by PowerDNS to create a slave record for a superMaster - virtual bool createSlaveDomain(const string& ip, const DNSName& domain, const string& nameserver, const string& account) + virtual bool createSlaveDomain(const string& /* ip */, const DNSName& /* domain */, const string& /* nameserver */, const string& /* account */) { return false; } //! called to delete a domain, incl. all metadata, zone contents, etc. - virtual bool deleteDomain(const DNSName &domain) + virtual bool deleteDomain(const DNSName& /* domain */) { return false; } - virtual string directBackendCmd(const string &query) + virtual string directBackendCmd(const string& /* query */) { return "directBackendCmd not supported for this backend\n"; } //! Search for records, returns true if search was done successfully. - virtual bool searchRecords(const string &pattern, int maxResults, vector& result) + virtual bool searchRecords(const string& /* pattern */, int /* maxResults */, vector& /* result */) { return false; } //! Search for comments, returns true if search was done successfully. - virtual bool searchComments(const string &pattern, int maxResults, vector& result) + virtual bool searchComments(const string& /* pattern */, int /* maxResults */, vector& /* result */) { return false; } @@ -482,9 +482,9 @@ public: { return this->make(suffix); } - virtual void declareArguments(const string &suffix=""){} - const string &getName() const; - + virtual void declareArguments(const string& /* suffix */ = "") {} + [[nodiscard]] const string& getName() const; + protected: void declare(const string &suffix, const string ¶m, const string &explanation, const string &value); diff --git a/pdns/dnsdist-cache.cc b/pdns/dnsdist-cache.cc index 2c4a8304a0..a5bd944ee9 100644 --- a/pdns/dnsdist-cache.cc +++ b/pdns/dnsdist-cache.cc @@ -299,8 +299,8 @@ bool DNSDistPacketCache::get(DNSQuestion& dq, uint16_t queryId, uint32_t* keyOut ageDNSPacket(reinterpret_cast(&response[0]), response.size(), age); } else { - editDNSPacketTTL(reinterpret_cast(&response[0]), response.size(), - [staleTTL = d_staleTTL](uint8_t section, uint16_t class_, uint16_t type, uint32_t ttl) { return staleTTL; }); + editDNSPacketTTL(reinterpret_cast(&response[0]), response.size(), + [staleTTL = d_staleTTL](uint8_t /* section */, uint16_t /* class_ */, uint16_t /* type */, uint32_t /* ttl */) { return staleTTL; }); } } @@ -533,8 +533,7 @@ std::set DNSDistPacketCache::getDomainsContainingRecords(const ComboAdd } bool found = false; - bool valid = visitDNSPacket(value.value, [addr, &found](uint8_t section, uint16_t qclass, uint16_t qtype, uint32_t ttl, uint16_t rdatalength, const char* rdata) { - + bool valid = visitDNSPacket(value.value, [addr, &found](uint8_t /* section */, uint16_t qclass, uint16_t qtype, uint32_t /* ttl */, uint16_t rdatalength, const char* rdata) { if (qtype == QType::A && qclass == QClass::IN && addr.isIPv4() && rdatalength == 4 && rdata != nullptr) { ComboAddress parsed; parsed.sin4.sin_family = AF_INET; @@ -595,8 +594,7 @@ std::set DNSDistPacketCache::getRecordsForDomain(const DNSName& do continue; } - visitDNSPacket(value.value, [&addresses](uint8_t section, uint16_t qclass, uint16_t qtype, uint32_t ttl, uint16_t rdatalength, const char* rdata) { - + visitDNSPacket(value.value, [&addresses](uint8_t /* section */, uint16_t qclass, uint16_t qtype, uint32_t /* ttl */, uint16_t rdatalength, const char* rdata) { if (qtype == QType::A && qclass == QClass::IN && rdatalength == 4 && rdata != nullptr) { ComboAddress parsed; parsed.sin4.sin_family = AF_INET; diff --git a/pdns/dnsdist-cache.hh b/pdns/dnsdist-cache.hh index cce3708312..d8837bec5d 100644 --- a/pdns/dnsdist-cache.hh +++ b/pdns/dnsdist-cache.hh @@ -110,7 +110,7 @@ private: CacheShard() { } - CacheShard(const CacheShard& old) + CacheShard(const CacheShard& /* old */) { } diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index 3860493eb7..0b486edef3 100644 --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -61,7 +61,7 @@ UnknownRecordContent::UnknownRecordContent(const string& zone) d_record.insert(d_record.end(), out.begin(), out.end()); } -string UnknownRecordContent::getZoneRepresentation(bool noDot) const +string UnknownRecordContent::getZoneRepresentation(bool /* noDot */) const { ostringstream str; str<<"\\# "<<(unsigned int)d_record.size()<<" "; @@ -678,7 +678,7 @@ void PacketReader::xfrSvcParamKeyVals(set &kvs) { } -void PacketReader::xfrHexBlob(string& blob, bool keepReading) +void PacketReader::xfrHexBlob(string& blob, bool /* keepReading */) { xfrBlob(blob); } diff --git a/pdns/dnsparser.hh b/pdns/dnsparser.hh index 72b9e316d8..c19c766c5e 100644 --- a/pdns/dnsparser.hh +++ b/pdns/dnsparser.hh @@ -135,10 +135,9 @@ public: val=get8BitInt(); } - - void xfrName(DNSName &name, bool compress=false, bool noDot=false) + void xfrName(DNSName& name, bool /* compress */ = false, bool /* noDot */ = false) { - name=getName(); + name = getName(); } void xfrText(string &text, bool multi=false, bool lenField=true) diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index c70e6fc5be..80417bae6b 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -476,7 +476,8 @@ void EUI48RecordContent::toPacket(DNSPacketWriter& pw) string blob(d_eui48, d_eui48+6); pw.xfrBlob(blob); } -string EUI48RecordContent::getZoneRepresentation(bool noDot) const + +string EUI48RecordContent::getZoneRepresentation(bool /* noDot */) const { char tmp[18]; snprintf(tmp,sizeof(tmp),"%02x-%02x-%02x-%02x-%02x-%02x", @@ -520,7 +521,8 @@ void EUI64RecordContent::toPacket(DNSPacketWriter& pw) string blob(d_eui64, d_eui64+8); pw.xfrBlob(blob); } -string EUI64RecordContent::getZoneRepresentation(bool noDot) const + +string EUI64RecordContent::getZoneRepresentation(bool /* noDot */) const { char tmp[24]; snprintf(tmp,sizeof(tmp),"%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x", @@ -703,7 +705,7 @@ void APLRecordContent::toPacket(DNSPacketWriter& pw) { } // Decode record into string -string APLRecordContent::getZoneRepresentation(bool noDot) const { +string APLRecordContent::getZoneRepresentation(bool /* noDot */) const { string s_n, s_family, output; ComboAddress ca; Netmask nm; @@ -886,7 +888,7 @@ bool getEDNSOpts(const MOADNSParser& mdp, EDNSOpts* eo) return false; } -DNSRecord makeOpt(const uint16_t udpsize, const uint16_t extRCode, const uint16_t extFlags) +DNSRecord makeOpt(const uint16_t udpsize, const uint16_t /* extRCode */, const uint16_t extFlags) { EDNS0Record stuff; stuff.extRCode=0; diff --git a/pdns/dnsrecords.hh b/pdns/dnsrecords.hh index 4201448757..19fa6eef55 100644 --- a/pdns/dnsrecords.hh +++ b/pdns/dnsrecords.hh @@ -1034,14 +1034,14 @@ string RNAME##RecordContent::getZoneRepresentation(bool noDot) const } -#define boilerplate_conv(RNAME, CONV) \ -boilerplate(RNAME) \ -template \ -void RNAME##RecordContent::xfrPacket(Convertor& conv, bool noDot) \ -{ \ - CONV; \ +#define boilerplate_conv(RNAME, CONV) \ +boilerplate(RNAME) \ +template \ +void RNAME##RecordContent::xfrPacket(Convertor& conv, bool /* noDot */) \ +{ \ + CONV; \ if (conv.eof() == false) throw MOADNSException("When parsing " #RNAME " trailing data was not parsed: '" + conv.getRemaining() + "'"); \ -} \ +} \ struct EDNSOpts { diff --git a/pdns/dnsscope.cc b/pdns/dnsscope.cc index 76190a57da..2f858813a4 100644 --- a/pdns/dnsscope.cc +++ b/pdns/dnsscope.cc @@ -106,7 +106,7 @@ struct LiveCounts } }; -static void visitor(const StatNode* node, const StatNode::Stat& selfstat, const StatNode::Stat& childstat) +static void visitor(const StatNode* node, const StatNode::Stat& /* selfstat */, const StatNode::Stat& childstat) { // 20% servfails, >100 children, on average less than 2 copies of a query // >100 different subqueries diff --git a/pdns/dnssecsigner.cc b/pdns/dnssecsigner.cc index 004c5d2cf1..702e791a7d 100644 --- a/pdns/dnssecsigner.cc +++ b/pdns/dnssecsigner.cc @@ -176,7 +176,7 @@ static void addSignature(DNSSECKeeper& dk, UeberBackend& db, const DNSName& sign toSign.clear(); } -uint64_t signatureCacheSize(const std::string& str) +uint64_t signatureCacheSize(const std::string& /* str */) { return g_signatures.read_lock()->size(); } diff --git a/pdns/dnswriter.cc b/pdns/dnswriter.cc index 187f8e3370..cc6f32516f 100644 --- a/pdns/dnswriter.cc +++ b/pdns/dnswriter.cc @@ -392,7 +392,7 @@ template void GenericDNSPacketWriter::xfrBlobNoS xfrBlob(blob); } -template void GenericDNSPacketWriter::xfrHexBlob(const string& blob, bool keepReading) +template void GenericDNSPacketWriter::xfrHexBlob(const string& blob, bool /* keepReading */) { xfrBlob(blob); } diff --git a/pdns/doh.hh b/pdns/doh.hh index 325776bcdc..96e65f1be2 100644 --- a/pdns/doh.hh +++ b/pdns/doh.hh @@ -139,11 +139,11 @@ struct DOHFrontend { } - void rotateTicketsKey(time_t now) + void rotateTicketsKey(time_t /* now */) { } - void loadTicketsKeys(const std::string& keyFile) + void loadTicketsKeys(const std::string& /* keyFile */) { } diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index a354dab4bc..730d324cdb 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -50,7 +50,7 @@ bool DLQuitPlease() return s_pleasequit; } -string DLQuitHandler(const vector&parts, Utility::pid_t ppid) +string DLQuitHandler(const vector& parts, Utility::pid_t /* ppid */) { string ret="No return value"; if(parts[0]=="QUIT") { @@ -66,7 +66,7 @@ static void dokill(int) exit(0); } -string DLCurrentConfigHandler(const vector&parts, Utility::pid_t ppid) +string DLCurrentConfigHandler(const vector& parts, Utility::pid_t /* ppid */) { if(parts.size() > 1) { if(parts.size() == 2 && parts[1] == "diff") { @@ -77,19 +77,20 @@ string DLCurrentConfigHandler(const vector&parts, Utility::pid_t ppid) return ::arg().configstring(true, true); } -string DLRQuitHandler(const vector&parts, Utility::pid_t ppid) +string DLRQuitHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { signal(SIGALRM, dokill); alarm(1); return "Exiting"; } -string DLPingHandler(const vector&parts, Utility::pid_t ppid) +string DLPingHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { return "PONG"; } -string DLShowHandler(const vector&parts, Utility::pid_t ppid) { +string DLShowHandler(const vector& parts, Utility::pid_t /* ppid */) +{ try { extern StatBag S; string ret("Wrong number of parameters"); @@ -114,21 +115,21 @@ void setStatus(const string &str) d_status=str; } -string DLStatusHandler(const vector&parts, Utility::pid_t ppid) +string DLStatusHandler(const vector& /* parts */, Utility::pid_t ppid) { ostringstream os; os<&parts, Utility::pid_t ppid) +string DLUptimeHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { ostringstream os; os<&parts, Utility::pid_t ppid) +string DLPurgeHandler(const vector& parts, Utility::pid_t /* ppid */) { ostringstream os; int ret=0; @@ -153,7 +154,7 @@ string DLPurgeHandler(const vector&parts, Utility::pid_t ppid) return os.str(); } -string DLCCHandler(const vector&parts, Utility::pid_t ppid) +string DLCCHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { extern AuthPacketCache PC; extern AuthQueryCache QC; @@ -162,7 +163,7 @@ string DLCCHandler(const vector&parts, Utility::pid_t ppid) ostringstream os; bool first=true; for(map::const_iterator i=counts.begin();i!=counts.end();++i) { - if(!first) + if(!first) os<<", "; first=false; @@ -170,24 +171,24 @@ string DLCCHandler(const vector&parts, Utility::pid_t ppid) os<<"negative queries: "; else if(i->first=='Q') os<<"queries: "; - else + else os<<"unknown: "; os<second; } - if(!first) + if(!first) os<<", "; os<<"packets: "<&parts, Utility::pid_t ppid) +string DLQTypesHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { return g_rs.getQTypeReport(); } -string DLRSizesHandler(const vector&parts, Utility::pid_t ppid) +string DLRSizesHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { typedef map respsizes_t; respsizes_t respsizes = g_rs.getSizeResponseCounts(); @@ -199,7 +200,7 @@ string DLRSizesHandler(const vector&parts, Utility::pid_t ppid) return os.str(); } -string DLRemotesHandler(const vector&parts, Utility::pid_t ppid) +string DLRemotesHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { extern StatBag S; typedef vector > totals_t; @@ -212,7 +213,7 @@ string DLRemotesHandler(const vector&parts, Utility::pid_t ppid) return ret; } -string DLSettingsHandler(const vector&parts, Utility::pid_t ppid) +string DLSettingsHandler(const vector& parts, Utility::pid_t /* ppid */) { static const char *whitelist[]={"query-logging",nullptr}; const char **p; @@ -220,7 +221,7 @@ string DLSettingsHandler(const vector&parts, Utility::pid_t ppid) if(parts.size()!=3) { return "Syntax: set variable value"; } - + for(p=whitelist;*p;p++) if(*p==parts[1]) break; @@ -234,12 +235,12 @@ string DLSettingsHandler(const vector&parts, Utility::pid_t ppid) } -string DLVersionHandler(const vector&parts, Utility::pid_t ppid) +string DLVersionHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { return VERSION; } -string DLNotifyRetrieveHandler(const vector&parts, Utility::pid_t ppid) +string DLNotifyRetrieveHandler(const vector& parts, Utility::pid_t /* ppid */) { extern CommunicatorClass Communicator; ostringstream os; @@ -285,7 +286,7 @@ string DLNotifyRetrieveHandler(const vector&parts, Utility::pid_t ppid) return "Added retrieval request for '" + domain.toLogString() + "' from primary " + master.toLogString(); } -string DLNotifyHostHandler(const vector&parts, Utility::pid_t ppid) +string DLNotifyHostHandler(const vector& parts, Utility::pid_t /* ppid */) { extern CommunicatorClass Communicator; ostringstream os; @@ -313,7 +314,7 @@ string DLNotifyHostHandler(const vector&parts, Utility::pid_t ppid) return "Added to queue"; } -string DLNotifyHandler(const vector&parts, Utility::pid_t ppid) +string DLNotifyHandler(const vector& parts, Utility::pid_t /* ppid */) { extern CommunicatorClass Communicator; UeberBackend B; @@ -353,7 +354,7 @@ string DLNotifyHandler(const vector&parts, Utility::pid_t ppid) } } -string DLRediscoverHandler(const vector&parts, Utility::pid_t ppid) +string DLRediscoverHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { UeberBackend B; try { @@ -368,7 +369,7 @@ string DLRediscoverHandler(const vector&parts, Utility::pid_t ppid) } -string DLReloadHandler(const vector&parts, Utility::pid_t ppid) +string DLReloadHandler(const vector& /* parts */, Utility::pid_t /* ppid */) { UeberBackend B; B.reload(); @@ -376,8 +377,7 @@ string DLReloadHandler(const vector&parts, Utility::pid_t ppid) return "Ok"; } - -string DLListZones(const vector&parts, Utility::pid_t ppid) +string DLListZones(const vector& parts, Utility::pid_t /* ppid */) { UeberBackend B; g_log<&parts, Utility::pid_t ppid) extern bool PKCS11ModuleSlotLogin(const std::string& module, const string& tokenId, const std::string& pin); #endif -string DLTokenLogin(const vector&parts, Utility::pid_t ppid) +string DLTokenLogin(const vector& parts, Utility::pid_t /* ppid */) { #ifndef HAVE_P11KIT1 return "PKCS#11 support not compiled in"; @@ -427,7 +427,8 @@ string DLTokenLogin(const vector&parts, Utility::pid_t ppid) #endif } -string DLSuckRequests(const vector &parts, Utility::pid_t ppid) { +string DLSuckRequests(const vector& /* parts */, Utility::pid_t /* ppid */) +{ string ret; for (auto const &d: Communicator.getSuckRequests()) { ret += d.first.toString() + " " + d.second.toString() + "\n"; diff --git a/pdns/ixfrdist-stats.hh b/pdns/ixfrdist-stats.hh index 74d0344d05..755e57bfb6 100644 --- a/pdns/ixfrdist-stats.hh +++ b/pdns/ixfrdist-stats.hh @@ -64,9 +64,12 @@ class ixfrdistStats { void registerDomain(const DNSName& d) { domainStats[d].haveZone = false; } - void incrementUnknownDomainInQueries(const DNSName &d) { // the name is ignored. It would be great to report it, but we don't want to blow up Prometheus + + void incrementUnknownDomainInQueries(const DNSName& /* d */) + { // the name is ignored. It would be great to report it, but we don't want to blow up Prometheus progStats.unknownDomainInQueries += 1; } + private: class perDomainStat { public: diff --git a/pdns/ixfrdist.cc b/pdns/ixfrdist.cc index 997fdf9012..2c7e3d4d87 100644 --- a/pdns/ixfrdist.cc +++ b/pdns/ixfrdist.cc @@ -665,7 +665,7 @@ static bool handleAXFR(int fd, const MOADNSParser& mdp) { /* Produces an IXFR if one can be made according to the rules in RFC 1995 and * creates a SOA or AXFR packet when required by the RFC. */ -static bool handleIXFR(int fd, const ComboAddress& destination, const MOADNSParser& mdp, const shared_ptr& clientSOA) { +static bool handleIXFR(int fd, const ComboAddress& /* destination */, const MOADNSParser& mdp, const shared_ptr& clientSOA) { vector> toSend; /* we get a shared pointer of the zone info that we can't modify, ever. diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index ca9fe08023..a5f5ccaef9 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -972,7 +972,7 @@ static void setupLuaRecords(LuaContext& lua) lua.executeCode(boost::str(boost::format("debug.sethook(report, '', %d)") % g_luaRecordExecLimit)); } - lua.writeFunction("report", [](string event, boost::optional line){ + lua.writeFunction("report", [](string /* event */, boost::optional /* line */){ throw std::runtime_error("Script took too long"); }); diff --git a/pdns/minicurl.cc b/pdns/minicurl.cc index d37cd9e555..5d45406f1e 100644 --- a/pdns/minicurl.cc +++ b/pdns/minicurl.cc @@ -80,7 +80,7 @@ size_t MiniCurl::write_callback(char *ptr, size_t size, size_t nmemb, void *user } #if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM >= 0x072000 // 7.32.0 -size_t MiniCurl::progress_callback(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) +size_t MiniCurl::progress_callback(void *clientp, curl_off_t /* dltotal */, curl_off_t dlnow, curl_off_t /* ultotal */, curl_off_t /* ulnow */) { if (clientp != nullptr) { MiniCurl* us = static_cast(clientp); diff --git a/pdns/misc.cc b/pdns/misc.cc index 2afaa139b7..b28b4a2b0c 100644 --- a/pdns/misc.cc +++ b/pdns/misc.cc @@ -1257,7 +1257,7 @@ uint64_t udp6ErrorStats(const std::string& str) return 0; } -uint64_t tcpErrorStats(const std::string& str) +uint64_t tcpErrorStats(const std::string& /* str */) { #ifdef __linux__ ifstream ifs("/proc/net/netstat"); @@ -1282,7 +1282,7 @@ uint64_t tcpErrorStats(const std::string& str) return 0; } -uint64_t getCPUIOWait(const std::string& str) +uint64_t getCPUIOWait(const std::string& /* str */) { #ifdef __linux__ ifstream ifs("/proc/stat"); @@ -1307,7 +1307,7 @@ uint64_t getCPUIOWait(const std::string& str) return 0; } -uint64_t getCPUSteal(const std::string& str) +uint64_t getCPUSteal(const std::string& /* str */) { #ifdef __linux__ ifstream ifs("/proc/stat"); diff --git a/pdns/nsecrecords.cc b/pdns/nsecrecords.cc index 50837b66f4..3bf755ed6e 100644 --- a/pdns/nsecrecords.cc +++ b/pdns/nsecrecords.cc @@ -192,7 +192,7 @@ void NSECRecordContent::toPacket(DNSPacketWriter& pw) d_bitmap.toPacket(pw); } -std::shared_ptr NSECRecordContent::make(const DNSRecord &dr, PacketReader& pr) +std::shared_ptr NSECRecordContent::make(const DNSRecord & /* dr */, PacketReader& pr) { auto ret=std::make_shared(); pr.xfrName(ret->d_next); @@ -202,7 +202,7 @@ std::shared_ptr NSECRecordContent::make(con return ret; } -string NSECRecordContent::getZoneRepresentation(bool noDot) const +string NSECRecordContent::getZoneRepresentation(bool /* noDot */) const { string ret; RecordTextWriter rtw(ret); @@ -254,7 +254,7 @@ void NSEC3RecordContent::toPacket(DNSPacketWriter& pw) d_bitmap.toPacket(pw); } -std::shared_ptr NSEC3RecordContent::make(const DNSRecord &dr, PacketReader& pr) +std::shared_ptr NSEC3RecordContent::make(const DNSRecord& /* dr */, PacketReader& pr) { auto ret=std::make_shared(); pr.xfr8BitInt(ret->d_algorithm); @@ -271,7 +271,7 @@ std::shared_ptr NSEC3RecordContent::make(c return ret; } -string NSEC3RecordContent::getZoneRepresentation(bool noDot) const +string NSEC3RecordContent::getZoneRepresentation(bool /* noDot */) const { string ret; RecordTextWriter rtw(ret); @@ -316,7 +316,7 @@ void NSEC3PARAMRecordContent::toPacket(DNSPacketWriter& pw) pw.xfrBlob(d_salt); } -std::shared_ptr NSEC3PARAMRecordContent::make(const DNSRecord &dr, PacketReader& pr) +std::shared_ptr NSEC3PARAMRecordContent::make(const DNSRecord& /* dr */, PacketReader& pr) { auto ret=std::make_shared(); pr.xfr8BitInt(ret->d_algorithm); @@ -328,7 +328,7 @@ std::shared_ptr NSEC3PARAMRecordConte return ret; } -string NSEC3PARAMRecordContent::getZoneRepresentation(bool noDot) const +string NSEC3PARAMRecordContent::getZoneRepresentation(bool /* noDot */) const { string ret; RecordTextWriter rtw(ret); @@ -374,7 +374,7 @@ void CSYNCRecordContent::toPacket(DNSPacketWriter& pw) d_bitmap.toPacket(pw); } -std::shared_ptr CSYNCRecordContent::make(const DNSRecord &dr, PacketReader& pr) +std::shared_ptr CSYNCRecordContent::make(const DNSRecord& /* dr */, PacketReader& pr) { auto ret=std::make_shared(); pr.xfr32BitInt(ret->d_serial); @@ -384,7 +384,7 @@ std::shared_ptr CSYNCRecordContent::make(c return ret; } -string CSYNCRecordContent::getZoneRepresentation(bool noDot) const +string CSYNCRecordContent::getZoneRepresentation(bool /* noDot */) const { string ret; RecordTextWriter rtw(ret); diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index c63ec0b80d..a1e3c71afe 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -459,7 +459,7 @@ bool PacketHandler::getBestWildcard(DNSPacket& p, const DNSName &target, DNSName return haveSomething; } -DNSName PacketHandler::doAdditionalServiceProcessing(const DNSName &firstTarget, const uint16_t &qtype, std::unique_ptr& r, vector& extraRecords) { +DNSName PacketHandler::doAdditionalServiceProcessing(const DNSName &firstTarget, const uint16_t &qtype, std::unique_ptr& /* r */, vector& extraRecords) { DNSName ret = firstTarget; size_t ctr = 5; // Max 5 SVCB Aliasforms per query bool done = false; @@ -909,7 +909,7 @@ void PacketHandler::addNSEC3(DNSPacket& p, std::unique_ptr& r, const } } -void PacketHandler::addNSEC(DNSPacket& p, std::unique_ptr& r, const DNSName& target, const DNSName& wildcard, int mode) +void PacketHandler::addNSEC(DNSPacket& /* p */, std::unique_ptr& r, const DNSName& target, const DNSName& wildcard, int mode) { DLOG(g_log<<"addNSEC() mode="< maker(unsigned int algorithm); }; diff --git a/pdns/pollmplexer.cc b/pdns/pollmplexer.cc index 70a660ba89..8d33123c3d 100644 --- a/pdns/pollmplexer.cc +++ b/pdns/pollmplexer.cc @@ -28,7 +28,7 @@ FDMultiplexer* FDMultiplexer::getMultiplexerSilent(unsigned int maxEventsHint) class PollFDMultiplexer : public FDMultiplexer { public: - PollFDMultiplexer(unsigned int maxEventsHint) + PollFDMultiplexer(unsigned int /* maxEventsHint */) {} ~PollFDMultiplexer() { diff --git a/pdns/rcpgenerator.cc b/pdns/rcpgenerator.cc index 4e305849c2..00a53de67a 100644 --- a/pdns/rcpgenerator.cc +++ b/pdns/rcpgenerator.cc @@ -568,7 +568,7 @@ void RecordTextWriter::xfrBase32HexBlob(const string& val) } -void RecordTextReader::xfrText(string& val, bool multi, bool lenField) +void RecordTextReader::xfrText(string& val, bool multi, bool /* lenField */) { val.clear(); val.reserve(d_end - d_pos); @@ -607,7 +607,7 @@ void RecordTextReader::xfrText(string& val, bool multi, bool lenField) } } -void RecordTextReader::xfrUnquotedText(string& val, bool lenField) +void RecordTextReader::xfrUnquotedText(string& val, bool /* lenField */) { val.clear(); val.reserve(d_end - d_pos); @@ -741,7 +741,7 @@ void RecordTextWriter::xfrIP6(const std::string& val) d_string += std::string(addrbuf); } -void RecordTextWriter::xfrCAWithoutPort(uint8_t version, ComboAddress &val) +void RecordTextWriter::xfrCAWithoutPort(uint8_t /* version */, ComboAddress &val) { string ip = val.toString(); @@ -781,7 +781,7 @@ void RecordTextWriter::xfr8BitInt(const uint8_t& val) } // should not mess with the escapes -void RecordTextWriter::xfrName(const DNSName& val, bool, bool noDot) +void RecordTextWriter::xfrName(const DNSName& val, bool /* unused */, bool /* noDot */) { if(!d_string.empty()) d_string.append(1,' '); @@ -941,7 +941,7 @@ void RecordTextWriter::xfrSvcParamKeyVals(const set& val) { } } -void RecordTextWriter::xfrText(const string& val, bool multi, bool lenField) +void RecordTextWriter::xfrText(const string& val, bool /* multi */, bool /* lenField */) { if(!d_string.empty()) d_string.append(1,' '); @@ -949,7 +949,7 @@ void RecordTextWriter::xfrText(const string& val, bool multi, bool lenField) d_string.append(val); } -void RecordTextWriter::xfrUnquotedText(const string& val, bool lenField) +void RecordTextWriter::xfrUnquotedText(const string& val, bool /* lenField */) { if(!d_string.empty()) d_string.append(1,' '); diff --git a/pdns/resolver.cc b/pdns/resolver.cc index 1edc3ab984..ae29350e3f 100644 --- a/pdns/resolver.cc +++ b/pdns/resolver.cc @@ -193,7 +193,7 @@ uint16_t Resolver::sendResolve(const ComboAddress& remote, const ComboAddress& l namespace pdns { namespace resolver { - int parseResult(MOADNSParser& mdp, const DNSName& origQname, uint16_t origQtype, uint16_t id, Resolver::res_t* result) + int parseResult(MOADNSParser& mdp, const DNSName& origQname, uint16_t /* origQtype */, uint16_t id, Resolver::res_t* result) { result->clear(); diff --git a/pdns/responsestats.cc b/pdns/responsestats.cc index 0acc334132..128776cde9 100644 --- a/pdns/responsestats.cc +++ b/pdns/responsestats.cc @@ -47,7 +47,7 @@ void ResponseStats::submitResponse(uint16_t qtype, uint16_t respsize, uint8_t rc submitResponse(qtype, respsize, udpOrTCP); } -void ResponseStats::submitResponse(uint16_t qtype, uint16_t respsize, bool udpOrTCP) const +void ResponseStats::submitResponse(uint16_t qtype, uint16_t respsize, bool /* udpOrTCP */) const { d_qtypecounters.at(qtype).value++; d_sizecounters(respsize); diff --git a/pdns/sillyrecords.cc b/pdns/sillyrecords.cc index c43b549d1a..e66856e103 100644 --- a/pdns/sillyrecords.cc +++ b/pdns/sillyrecords.cc @@ -180,7 +180,7 @@ void LOCRecordContent::toPacket(DNSPacketWriter& pw) pw.xfr32BitInt(d_altitude); } -std::shared_ptr LOCRecordContent::make(const DNSRecord &dr, PacketReader& pr) +std::shared_ptr LOCRecordContent::make(const DNSRecord& /* dr */, PacketReader& pr) { auto ret=std::make_shared(); pr.xfr8BitInt(ret->d_version); @@ -195,7 +195,7 @@ std::shared_ptr LOCRecordContent::make(const return ret; } -LOCRecordContent::LOCRecordContent(const string& content, const string& zone) +LOCRecordContent::LOCRecordContent(const string& content, const string& /* zone */) { // 51 59 00.000 N 5 55 00.000 E 4.00m 1.00m 10000.00m 10.00m // convert this to d_version, d_size, d_horiz/vertpre, d_latitude, d_longitude, d_altitude @@ -296,7 +296,7 @@ LOCRecordContent::LOCRecordContent(const string& content, const string& zone) } -string LOCRecordContent::getZoneRepresentation(bool noDot) const +string LOCRecordContent::getZoneRepresentation(bool /* noDot */) const { // convert d_version, d_size, d_horiz/vertpre, d_latitude, d_longitude, d_altitude to: // 51 59 00.000 N 5 55 00.000 E 4.00m 1.00m 10000.00m 10.00m diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index 80236154ad..62d110929b 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -421,8 +421,7 @@ static bool catalogProcess(const DomainInfo& di, vector& rrs, return catalogDiff(di, fromXFR, fromDB, logPrefix); } -void CommunicatorClass::ixfrSuck(const DNSName &domain, const TSIGTriplet& tt, const ComboAddress& laddr, const ComboAddress& remote, unique_ptr& pdl, - ZoneStatus& zs, vector* axfr) +void CommunicatorClass::ixfrSuck(const DNSName& domain, const TSIGTriplet& tt, const ComboAddress& laddr, const ComboAddress& remote, unique_ptr& /* pdl */, ZoneStatus& zs, vector* axfr) { string logPrefix="IXFR-in zone '"+domain.toLogString()+"', primary '"+remote.toString()+"', "; @@ -1045,7 +1044,7 @@ struct SlaveSenderReceiver { } - void deliverTimeout(const Identifier& i) + void deliverTimeout(const Identifier& /* i */) { } @@ -1073,7 +1072,7 @@ struct SlaveSenderReceiver return d_resolver.tryGetSOASerial(&(std::get<0>(id)), &(std::get<1>(id)), &a.theirSerial, &a.theirInception, &a.theirExpire, &(std::get<2>(id))); } - void deliverAnswer(const DomainNotificationInfo& dni, const Answer& a, unsigned int usec) + void deliverAnswer(const DomainNotificationInfo& dni, const Answer& a, unsigned int /* usec */) { d_freshness[dni.di.id]=a; } diff --git a/pdns/sstuff.hh b/pdns/sstuff.hh index 4024e0c11d..65b0054da0 100644 --- a/pdns/sstuff.hh +++ b/pdns/sstuff.hh @@ -184,7 +184,7 @@ public: dgram.assign(d_buffer, 0, static_cast(bytes)); } - bool recvFromAsync(string &dgram, ComboAddress &ep) + bool recvFromAsync(string &dgram, ComboAddress& /* ep */) { struct sockaddr_in remote; socklen_t remlen = sizeof(remote); diff --git a/pdns/tcpiohandler.hh b/pdns/tcpiohandler.hh index 68b1c02c63..a97c465e6c 100644 --- a/pdns/tcpiohandler.hh +++ b/pdns/tcpiohandler.hh @@ -80,7 +80,7 @@ public: virtual std::unique_ptr getConnection(int socket, const struct timeval& timeout, time_t now) = 0; virtual std::unique_ptr getClientConnection(const std::string& host, bool hostIsAddr, int socket, const struct timeval& timeout) = 0; virtual void rotateTicketsKey(time_t now) = 0; - virtual void loadTicketsKeys(const std::string& file) + virtual void loadTicketsKeys(const std::string& /* file */) { throw std::runtime_error("This TLS backend does not have the capability to load a tickets key from a file"); } @@ -116,7 +116,7 @@ public: virtual std::string getName() const = 0; /* set the advertised ALPN protocols, in client or server context */ - virtual bool setALPNProtos(const std::vector>& protos) + virtual bool setALPNProtos(const std::vector>& /* protos */) { return false; } @@ -233,7 +233,7 @@ class TCPIOHandler public: enum class Type : uint8_t { Client, Server }; - TCPIOHandler(const std::string& host, bool hostIsAddr, int socket, const struct timeval& timeout, std::shared_ptr ctx, time_t now): d_socket(socket) + TCPIOHandler(const std::string& host, bool hostIsAddr, int socket, const struct timeval& timeout, std::shared_ptr ctx, time_t /* now */): d_socket(socket) { if (ctx) { d_conn = ctx->getClientConnection(host, hostIsAddr, d_socket, timeout); diff --git a/pdns/test-distributor_hh.cc b/pdns/test-distributor_hh.cc index 88a75c13dd..679b1fa6c2 100644 --- a/pdns/test-distributor_hh.cc +++ b/pdns/test-distributor_hh.cc @@ -36,7 +36,7 @@ struct Backend }; static std::atomic g_receivedAnswers; -static void report(std::unique_ptr& A, int B) +static void report(std::unique_ptr& /* A */, int /* B */) { g_receivedAnswers++; } @@ -70,7 +70,7 @@ struct BackendSlow }; static std::atomic g_receivedAnswers1; -static void report1(std::unique_ptr& A, int B) +static void report1(std::unique_ptr& /* A */, int /* B */) { g_receivedAnswers1++; } @@ -104,7 +104,7 @@ struct BackendDies ~BackendDies() { } - std::unique_ptr question(Question& q) + std::unique_ptr question(Question& /* q */) { // cout<<"Q: "<qdomain< BackendDies::s_count; std::atomic g_receivedAnswers2; -static void report2(std::unique_ptr& A, int B) +static void report2(std::unique_ptr& /* A */, int /* B */) { g_receivedAnswers2++; } diff --git a/pdns/test-dnsrecords_cc.cc b/pdns/test-dnsrecords_cc.cc index cb028c4bf5..5b931945eb 100644 --- a/pdns/test-dnsrecords_cc.cc +++ b/pdns/test-dnsrecords_cc.cc @@ -332,7 +332,7 @@ BOOST_AUTO_TEST_CASE(test_record_types) { } } -static bool test_dnsrecords_cc_predicate( std::exception const &ex ) { return true; } +static bool test_dnsrecords_cc_predicate(std::exception const& /* ex */) { return true; } // these *MUST NOT* parse properly! BOOST_AUTO_TEST_CASE(test_record_types_bad_values) { diff --git a/pdns/test-ueberbackend_cc.cc b/pdns/test-ueberbackend_cc.cc index 6e35d384d5..b11219a4a5 100644 --- a/pdns/test-ueberbackend_cc.cc +++ b/pdns/test-ueberbackend_cc.cc @@ -184,7 +184,7 @@ public: return true; } - bool list(const DNSName& target, int zoneId, bool include_disabled = false) override + bool list(const DNSName& target, int zoneId, bool /* include_disabled */ = false) override { findZone(target, zoneId, d_records, d_currentZone); @@ -283,12 +283,12 @@ public: { } - bool getDomainMetadata(const DNSName& name, const std::string& kind, std::vector& meta) override + bool getDomainMetadata(const DNSName& /* name */, const std::string& /* kind */, std::vector& /* meta */) override { return false; } - bool setDomainMetadata(const DNSName& name, const std::string& kind, const std::vector& meta) override + bool setDomainMetadata(const DNSName& /* name */, const std::string& /* kind */, const std::vector& /* meta */) override { return false; } diff --git a/pdns/webserver.cc b/pdns/webserver.cc index f6f540789d..43cd180e82 100644 --- a/pdns/webserver.cc +++ b/pdns/webserver.cc @@ -431,7 +431,7 @@ void WebServer::logRequest(const HttpRequest& req, const ComboAddress& remote) c } } -void WebServer::logResponse(const HttpResponse& resp, const ComboAddress& remote, const string& logprefix) const { +void WebServer::logResponse(const HttpResponse& resp, const ComboAddress& /* remote */, const string& logprefix) const { if (d_loglevel >= WebServer::LogLevel::Detailed) { #ifdef RECURSOR if (!g_slogStructured) { diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 4be003cf50..11bfc38f37 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -536,7 +536,7 @@ static void validateGatheredRRType(const DNSResourceRecord& rr) { } } -static void gatherRecords(UeberBackend& B, const string& logprefix, const Json& container, const DNSName& qname, const QType& qtype, const int ttl, vector& new_records) { +static void gatherRecords(UeberBackend& /* B */, const string& /* logprefix */, const Json& container, const DNSName& qname, const QType& qtype, const int ttl, vector& new_records) { DNSResourceRecord rr; rr.qname = qname; rr.qtype = qtype; @@ -2397,7 +2397,7 @@ static void prometheusMetrics(HttpRequest* req, HttpResponse* resp) { resp->status = 200; } -void AuthWebServer::cssfunction(HttpRequest* req, HttpResponse* resp) +void AuthWebServer::cssfunction(HttpRequest* /* req */, HttpResponse* resp) { resp->headers["Cache-Control"] = "max-age=86400"; resp->headers["Content-Type"] = "text/css"; diff --git a/pdns/zone2json.cc b/pdns/zone2json.cc index 788f9e0012..51e861f04f 100644 --- a/pdns/zone2json.cc +++ b/pdns/zone2json.cc @@ -53,7 +53,7 @@ using namespace json11; StatBag S; static int g_numRecords; -static Json::object emitRecord(const string& zoneName, const DNSName &DNSqname, const string &qtype, const string &ocontent, int ttl) +static Json::object emitRecord(const string& /* zoneName */, const DNSName &DNSqname, const string &qtype, const string &ocontent, int ttl) { int prio=0; string retval;