[svn] commit: r1304 - in /trunk: ./ src/lib/dns/ src/lib/dns/rdata/ch_3/ src/lib/dns/rdata/generic/ src/lib/dns/rdata/hs_4/ src/lib/dns/rdata/in_1/
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Mar 10 23:59:30 UTC 2010
Author: jinmei
Date: Wed Mar 10 23:59:29 2010
New Revision: 1304
Log:
- made lib/dns -Wextra safe.
- introduced new macro UNUSED_PARAM to tell gcc that particular variables are
intentionally unused
- enabled -Wextra by default
Modified:
trunk/configure.ac
trunk/src/lib/dns/Makefile.am
trunk/src/lib/dns/message.cc
trunk/src/lib/dns/rdata.cc
trunk/src/lib/dns/rdata/ch_3/a_1.cc
trunk/src/lib/dns/rdata/generic/cname_5.cc
trunk/src/lib/dns/rdata/generic/dname_39.cc
trunk/src/lib/dns/rdata/generic/dnskey_48.cc
trunk/src/lib/dns/rdata/generic/ds_43.cc
trunk/src/lib/dns/rdata/generic/mx_15.cc
trunk/src/lib/dns/rdata/generic/ns_2.cc
trunk/src/lib/dns/rdata/generic/nsec3_50.cc
trunk/src/lib/dns/rdata/generic/nsec3param_51.cc
trunk/src/lib/dns/rdata/generic/nsec_47.cc
trunk/src/lib/dns/rdata/generic/opt_41.cc
trunk/src/lib/dns/rdata/generic/ptr_12.cc
trunk/src/lib/dns/rdata/generic/rrsig_46.cc
trunk/src/lib/dns/rdata/generic/soa_6.cc
trunk/src/lib/dns/rdata/generic/txt_16.cc
trunk/src/lib/dns/rdata/hs_4/a_1.cc
trunk/src/lib/dns/rdata/in_1/a_1.cc
trunk/src/lib/dns/rdata/in_1/aaaa_28.cc
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Wed Mar 10 23:59:29 2010
@@ -24,7 +24,9 @@
# default compiler warning settings
if test "X$GCC" = "Xyes"; then
CXXFLAGS="$CXXFLAGS -g -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
-fi
+UNUSED_PARAM_ATTRIBUTE='__attribute__((unused))'
+fi
+AC_DEFINE_UNQUOTED(UNUSED_PARAM, $UNUSED_PARAM_ATTRIBUTE, Define to compiler keyword indicating a function argument is intentionally unused)
# produce PIC unless we disable shared libraries. need this for python bindings.
if test $enable_shared != "no" -a "X$GCC" = "Xyes"; then
@@ -205,6 +207,7 @@
src/bin/loadzone/Makefile
src/bin/msgq/Makefile
src/bin/auth/Makefile
+ src/bin/auth/tests/Makefile
src/bin/xfrin/Makefile
src/bin/usermgr/Makefile
src/lib/Makefile
Modified: trunk/src/lib/dns/Makefile.am
==============================================================================
--- trunk/src/lib/dns/Makefile.am (original)
+++ trunk/src/lib/dns/Makefile.am Wed Mar 10 23:59:29 2010
@@ -1,6 +1,6 @@
SUBDIRS = . tests
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext -Wall -Werror
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext -Werror
CLEANFILES = *.gcno *.gcda
CLEANFILES += rrclass.h rrtype.h rrparamregistry.cc rdataclass.h rdataclass.cc
Modified: trunk/src/lib/dns/message.cc
==============================================================================
--- trunk/src/lib/dns/message.cc (original)
+++ trunk/src/lib/dns/message.cc Wed Mar 10 23:59:29 2010
@@ -225,9 +225,8 @@
#endif
void init();
- int parseQuestion(Message& message, InputBuffer& buffer);
- int parseSection(Message& messge, const Section& section,
- InputBuffer& buffer);
+ int parseQuestion(InputBuffer& buffer);
+ int parseSection(const Section& section, InputBuffer& buffer);
};
MessageImpl::MessageImpl(Message::Mode mode) :
@@ -551,17 +550,17 @@
impl_->counts_[Section::ADDITIONAL().getCode()] = buffer.readUint16();
impl_->counts_[Section::QUESTION().getCode()] =
- impl_->parseQuestion(*this, buffer);
+ impl_->parseQuestion(buffer);
impl_->counts_[Section::ANSWER().getCode()] =
- impl_->parseSection(*this, Section::ANSWER(), buffer);
+ impl_->parseSection(Section::ANSWER(), buffer);
impl_->counts_[Section::AUTHORITY().getCode()] =
- impl_->parseSection(*this, Section::AUTHORITY(), buffer);
+ impl_->parseSection(Section::AUTHORITY(), buffer);
impl_->counts_[Section::ADDITIONAL().getCode()] =
- impl_->parseSection(*this, Section::ADDITIONAL(), buffer);
+ impl_->parseSection(Section::ADDITIONAL(), buffer);
}
int
-MessageImpl::parseQuestion(Message& message, InputBuffer& buffer)
+MessageImpl::parseQuestion(InputBuffer& buffer)
{
unsigned int added = 0;
@@ -605,9 +604,7 @@
}
int
-MessageImpl::parseSection(Message& message, const Section& section,
- InputBuffer& buffer)
-{
+MessageImpl::parseSection(const Section& section, InputBuffer& buffer) {
unsigned int added = 0;
for (unsigned int count = 0; count < counts_[section.getCode()]; count++) {
Modified: trunk/src/lib/dns/rdata.cc
==============================================================================
--- trunk/src/lib/dns/rdata.cc (original)
+++ trunk/src/lib/dns/rdata.cc Wed Mar 10 23:59:29 2010
@@ -187,7 +187,7 @@
}
Generic::Generic(const Generic& source) :
- impl_(new GenericImpl(*source.impl_))
+ Rdata(), impl_(new GenericImpl(*source.impl_))
{}
Generic&
Modified: trunk/src/lib/dns/rdata/ch_3/a_1.cc
==============================================================================
--- trunk/src/lib/dns/rdata/ch_3/a_1.cc (original)
+++ trunk/src/lib/dns/rdata/ch_3/a_1.cc Wed Mar 10 23:59:29 2010
@@ -14,6 +14,8 @@
// $Id$
+#include <config.h> // for UNUSED_PARAM
+
#include <string>
#include "buffer.h"
@@ -27,29 +29,28 @@
// BEGIN_ISC_NAMESPACE
// BEGIN_RDATA_NAMESPACE
-A::A(const string& addrstr)
+A::A(const string& addrstr UNUSED_PARAM)
{
// TBD
}
-A::A(InputBuffer& buffer, size_t rdata_len)
+A::A(InputBuffer& buffer UNUSED_PARAM, size_t rdata_len UNUSED_PARAM)
{
// TBD
}
-A::A(const A& source)
+A::A(const A& source UNUSED_PARAM) : Rdata() {
+ // TBD
+}
+
+void
+A::toWire(OutputBuffer& buffer UNUSED_PARAM) const
{
// TBD
}
void
-A::toWire(OutputBuffer& buffer) const
-{
- // TBD
-}
-
-void
-A::toWire(MessageRenderer& renderer) const
+A::toWire(MessageRenderer& renderer UNUSED_PARAM) const
{
// TBD
}
@@ -62,7 +63,7 @@
}
int
-A::compare(const Rdata& other) const
+A::compare(const Rdata& other UNUSED_PARAM) const
{
return (0); // dummy. TBD
}
Modified: trunk/src/lib/dns/rdata/generic/cname_5.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/cname_5.cc (original)
+++ trunk/src/lib/dns/rdata/generic/cname_5.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
#include <string>
@@ -31,15 +33,15 @@
cname_(namestr)
{}
-CNAME::CNAME(InputBuffer& buffer, size_t rdata_len) :
- cname_(buffer)
+CNAME::CNAME(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
+ Rdata(), cname_(buffer)
{
// we don't need rdata_len for parsing. if necessary, the caller will
// check consistency.
}
CNAME::CNAME(const CNAME& other) :
- cname_(other.cname_)
+ Rdata(), cname_(other.cname_)
{}
CNAME::CNAME(const Name& cname) :
Modified: trunk/src/lib/dns/rdata/generic/dname_39.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/dname_39.cc (original)
+++ trunk/src/lib/dns/rdata/generic/dname_39.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include <config.h>
#include <string>
@@ -31,7 +33,7 @@
dname_(namestr)
{}
-DNAME::DNAME(InputBuffer& buffer, size_t rdata_len) :
+DNAME::DNAME(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
dname_(buffer)
{
// we don't need rdata_len for parsing. if necessary, the caller will
@@ -39,7 +41,7 @@
}
DNAME::DNAME(const DNAME& other) :
- dname_(other.dname_)
+ Rdata(), dname_(other.dname_)
{}
DNAME::DNAME(const Name& dname) :
Modified: trunk/src/lib/dns/rdata/generic/dnskey_48.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/dnskey_48.cc (original)
+++ trunk/src/lib/dns/rdata/generic/dnskey_48.cc Wed Mar 10 23:59:29 2010
@@ -14,6 +14,8 @@
// $Id$
+#include "config.h"
+
#include <iostream>
#include <string>
#include <sstream>
@@ -99,7 +101,7 @@
}
DNSKEY::DNSKEY(const DNSKEY& source) :
- impl_(new DNSKEYImpl(*source.impl_))
+ Rdata(), impl_(new DNSKEYImpl(*source.impl_))
{}
DNSKEY&
Modified: trunk/src/lib/dns/rdata/generic/ds_43.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/ds_43.cc (original)
+++ trunk/src/lib/dns/rdata/generic/ds_43.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include <config.h>
#include <iostream>
#include <string>
@@ -94,7 +96,7 @@
}
DS::DS(const DS& source) :
- impl_(new DSImpl(*source.impl_))
+ Rdata(), impl_(new DSImpl(*source.impl_))
{}
DS&
Modified: trunk/src/lib/dns/rdata/generic/mx_15.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/mx_15.cc (original)
+++ trunk/src/lib/dns/rdata/generic/mx_15.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
#include <string>
@@ -31,7 +33,7 @@
// BEGIN_ISC_NAMESPACE
// BEGIN_RDATA_NAMESPACE
-MX::MX(InputBuffer& buffer, size_t rdata_len) :
+MX::MX(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
preference_(buffer.readUint16()), mxname_(buffer)
{
// we don't need rdata_len for parsing. if necessary, the caller will
@@ -60,7 +62,7 @@
{}
MX::MX(const MX& other) :
- preference_(other.preference_), mxname_(other.mxname_)
+ Rdata(), preference_(other.preference_), mxname_(other.mxname_)
{}
void
Modified: trunk/src/lib/dns/rdata/generic/ns_2.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/ns_2.cc (original)
+++ trunk/src/lib/dns/rdata/generic/ns_2.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
#include <string>
@@ -31,7 +33,7 @@
nsname_(namestr)
{}
-NS::NS(InputBuffer& buffer, size_t rdata_len) :
+NS::NS(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
nsname_(buffer)
{
// we don't need rdata_len for parsing. if necessary, the caller will
@@ -39,7 +41,7 @@
}
NS::NS(const NS& other) :
- nsname_(other.nsname_)
+ Rdata(), nsname_(other.nsname_)
{}
void
Modified: trunk/src/lib/dns/rdata/generic/nsec3_50.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/nsec3_50.cc (original)
+++ trunk/src/lib/dns/rdata/generic/nsec3_50.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
#include <iostream>
#include <iomanip>
@@ -171,7 +173,7 @@
}
NSEC3::NSEC3(const NSEC3& source) :
- impl_(new NSEC3Impl(*source.impl_))
+ Rdata(), impl_(new NSEC3Impl(*source.impl_))
{}
NSEC3&
Modified: trunk/src/lib/dns/rdata/generic/nsec3param_51.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/nsec3param_51.cc (original)
+++ trunk/src/lib/dns/rdata/generic/nsec3param_51.cc Wed Mar 10 23:59:29 2010
@@ -14,6 +14,8 @@
// $Id$
+#include "config.h"
+
#include <iostream>
#include <string>
#include <sstream>
@@ -97,7 +99,7 @@
}
NSEC3PARAM::NSEC3PARAM(const NSEC3PARAM& source) :
- impl_(new NSEC3PARAMImpl(*source.impl_))
+ Rdata(), impl_(new NSEC3PARAMImpl(*source.impl_))
{}
NSEC3PARAM&
Modified: trunk/src/lib/dns/rdata/generic/nsec_47.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/nsec_47.cc (original)
+++ trunk/src/lib/dns/rdata/generic/nsec_47.cc Wed Mar 10 23:59:29 2010
@@ -14,6 +14,8 @@
// $Id$
+#include "config.h"
+
#include <iostream>
#include <string>
#include <sstream>
@@ -111,7 +113,7 @@
}
NSEC::NSEC(const NSEC& source) :
- impl_(new NSECImpl(*source.impl_))
+ Rdata(), impl_(new NSECImpl(*source.impl_))
{}
NSEC&
Modified: trunk/src/lib/dns/rdata/generic/opt_41.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/opt_41.cc (original)
+++ trunk/src/lib/dns/rdata/generic/opt_41.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,9 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
+
#include <string>
#include "buffer.h"
@@ -25,7 +28,7 @@
// BEGIN_ISC_NAMESPACE
// BEGIN_RDATA_NAMESPACE
-OPT::OPT(const string& type_str)
+OPT::OPT(const string& type_str UNUSED_PARAM)
{
isc_throw(InvalidRdataText, "OPT RR cannot be constructed from text");
}
@@ -42,7 +45,7 @@
buffer.setPosition(buffer.getPosition() + rdata_len);
}
-OPT::OPT(const OPT& source)
+OPT::OPT(const OPT& source UNUSED_PARAM) : Rdata()
{
// there's nothing to copy in this simple implementation.
}
@@ -54,13 +57,13 @@
}
void
-OPT::toWire(OutputBuffer& buffer) const
+OPT::toWire(OutputBuffer& buffer UNUSED_PARAM) const
{
// nothing to do, as this simple version doesn't support any options.
}
void
-OPT::toWire(MessageRenderer& renderer) const
+OPT::toWire(MessageRenderer& renderer UNUSED_PARAM) const
{
// nothing to do, as this simple version doesn't support any options.
}
Modified: trunk/src/lib/dns/rdata/generic/ptr_12.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/ptr_12.cc (original)
+++ trunk/src/lib/dns/rdata/generic/ptr_12.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
#include <string>
@@ -31,7 +33,7 @@
ptr_name_(type_str)
{}
-PTR::PTR(InputBuffer& buffer, size_t rdata_len) :
+PTR::PTR(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
ptr_name_(buffer)
{
// we don't need rdata_len for parsing. if necessary, the caller will
@@ -39,7 +41,7 @@
}
PTR::PTR(const PTR& source) :
- ptr_name_(source.ptr_name_)
+ Rdata(), ptr_name_(source.ptr_name_)
{}
std::string
Modified: trunk/src/lib/dns/rdata/generic/rrsig_46.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/rrsig_46.cc (original)
+++ trunk/src/lib/dns/rdata/generic/rrsig_46.cc Wed Mar 10 23:59:29 2010
@@ -14,6 +14,8 @@
// $Id$
+#include "config.h"
+
#include <string>
#include <iomanip>
#include <iostream>
@@ -137,7 +139,7 @@
}
RRSIG::RRSIG(const RRSIG& source) :
- impl_(new RRSIGImpl(*source.impl_))
+ Rdata(), impl_(new RRSIGImpl(*source.impl_))
{}
RRSIG&
Modified: trunk/src/lib/dns/rdata/generic/soa_6.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/soa_6.cc (original)
+++ trunk/src/lib/dns/rdata/generic/soa_6.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
#include <string>
@@ -31,7 +33,7 @@
// BEGIN_ISC_NAMESPACE
// BEGIN_RDATA_NAMESPACE
-SOA::SOA(InputBuffer& buffer, size_t rdata_len) :
+SOA::SOA(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM) :
mname_(buffer), rname_(buffer)
{
// we don't need rdata_len for parsing. if necessary, the caller will
@@ -85,7 +87,7 @@
}
SOA::SOA(const SOA& other) :
- mname_(other.mname_), rname_(other.rname_)
+ Rdata(), mname_(other.mname_), rname_(other.rname_)
{
memcpy(numdata_, other.numdata_, sizeof(numdata_));
}
Modified: trunk/src/lib/dns/rdata/generic/txt_16.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/txt_16.cc (original)
+++ trunk/src/lib/dns/rdata/generic/txt_16.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
#include <stdint.h>
#include <string.h>
@@ -30,7 +32,7 @@
// BEGIN_ISC_NAMESPACE
// BEGIN_RDATA_NAMESPACE
-TXT::TXT(InputBuffer& buffer, size_t rdata_len)
+TXT::TXT(InputBuffer& buffer, size_t rdata_len UNUSED_PARAM)
{
uint8_t len;
@@ -65,7 +67,7 @@
}
TXT::TXT(const TXT& other) :
- string_list_(other.string_list_)
+ Rdata(), string_list_(other.string_list_)
{}
void
Modified: trunk/src/lib/dns/rdata/hs_4/a_1.cc
==============================================================================
--- trunk/src/lib/dns/rdata/hs_4/a_1.cc (original)
+++ trunk/src/lib/dns/rdata/hs_4/a_1.cc Wed Mar 10 23:59:29 2010
@@ -14,6 +14,8 @@
// $Id$
+#include <config.h> // for UNUSED
+
#include <string>
#include "buffer.h"
@@ -27,29 +29,29 @@
// BEGIN_ISC_NAMESPACE
// BEGIN_RDATA_NAMESPACE
-A::A(const string& addrstr)
+A::A(const string& addrstr UNUSED_PARAM)
{
// TBD
}
-A::A(InputBuffer& buffer, size_t rdata_len)
+A::A(InputBuffer& buffer UNUSED_PARAM, size_t rdata_len UNUSED_PARAM)
{
// TBD
}
-A::A(const A& source)
+A::A(const A& source UNUSED_PARAM) : Rdata()
{
// TBD
}
void
-A::toWire(OutputBuffer& buffer) const
+A::toWire(OutputBuffer& buffer UNUSED_PARAM) const
{
// TBD
}
void
-A::toWire(MessageRenderer& renderer) const
+A::toWire(MessageRenderer& renderer UNUSED_PARAM) const
{
// TBD
}
@@ -62,7 +64,7 @@
}
int
-A::compare(const Rdata& other) const
+A::compare(const Rdata& other UNUSED_PARAM) const
{
return (0); // dummy. TBD
}
Modified: trunk/src/lib/dns/rdata/in_1/a_1.cc
==============================================================================
--- trunk/src/lib/dns/rdata/in_1/a_1.cc (original)
+++ trunk/src/lib/dns/rdata/in_1/a_1.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id: rdata.cc 545 2010-01-27 00:33:28Z jinmei $
+
+#include "config.h"
#include <stdint.h>
#include <string.h>
@@ -54,7 +56,7 @@
}
A::A(const A& other) :
- addr_(other.addr_)
+ Rdata(), addr_(other.addr_)
{}
void
Modified: trunk/src/lib/dns/rdata/in_1/aaaa_28.cc
==============================================================================
--- trunk/src/lib/dns/rdata/in_1/aaaa_28.cc (original)
+++ trunk/src/lib/dns/rdata/in_1/aaaa_28.cc Wed Mar 10 23:59:29 2010
@@ -13,6 +13,8 @@
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
+
+#include "config.h"
#include <stdint.h>
#include <string.h>
@@ -49,8 +51,7 @@
buffer.readData(&addr_, sizeof(addr_));
}
-AAAA::AAAA(const AAAA& other)
-{
+AAAA::AAAA(const AAAA& other) : Rdata() {
memcpy(addr_, other.addr_, sizeof(addr_));
}
More information about the bind10-changes
mailing list