BIND 10 trac2673, updated. 20f13469624c75aa090ad74f5ce2518adf826f01 [2673] Modifications to avoid clang warnings and errors in DHCP code
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jan 31 12:17:41 UTC 2013
The branch, trac2673 has been updated
via 20f13469624c75aa090ad74f5ce2518adf826f01 (commit)
from 53dec20f027b589c2202f182a01d8e33ef15c2a9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 20f13469624c75aa090ad74f5ce2518adf826f01
Author: Stephen Morris <stephen at isc.org>
Date: Thu Jan 31 12:16:22 2013 +0000
[2673] Modifications to avoid clang warnings and errors in DHCP code
-----------------------------------------------------------------------
Summary of changes:
src/bin/dhcp4/Makefile.am | 4 ++++
src/bin/dhcp4/config_parser.cc | 4 ++--
src/bin/dhcp4/dhcp4_srv.cc | 15 +++++++++++++++
src/bin/dhcp4/dhcp4_srv.h | 9 ---------
src/bin/dhcp4/tests/Makefile.am | 4 ++++
src/bin/dhcp6/Makefile.am | 4 ++++
src/bin/dhcp6/config_parser.cc | 4 ++--
src/bin/dhcp6/dhcp6_srv.cc | 10 ++++++++++
src/bin/dhcp6/dhcp6_srv.h | 10 ----------
src/bin/dhcp6/tests/Makefile.am | 4 ++++
src/bin/dhcp6/tests/config_parser_unittest.cc | 2 +-
11 files changed, 46 insertions(+), 24 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/Makefile.am b/src/bin/dhcp4/Makefile.am
index 12017e0..b3818c7 100644
--- a/src/bin/dhcp4/Makefile.am
+++ b/src/bin/dhcp4/Makefile.am
@@ -5,6 +5,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(B10_CXXFLAGS)
+if USE_CLANGPP
+# Disable unused parameter warning caused by some Boost headers when compiling with clang
+AM_CXXFLAGS += -Wno-unused-parameter
+endif
if USE_STATIC_LINK
AM_LDFLAGS = -static
diff --git a/src/bin/dhcp4/config_parser.cc b/src/bin/dhcp4/config_parser.cc
index 9e9360c..d8a586b 100644
--- a/src/bin/dhcp4/config_parser.cc
+++ b/src/bin/dhcp4/config_parser.cc
@@ -967,13 +967,13 @@ public:
return (new OptionDataListParser(param_name));
}
+ /// Pointer to options instances storage.
+ OptionStorage* options_;
/// Intermediate option storage. This storage is used by
/// lower level parsers to add new options. Values held
/// in this storage are assigned to main storage (options_)
/// if overall parsing was successful.
OptionStorage local_options_;
- /// Pointer to options instances storage.
- OptionStorage* options_;
/// Collection of parsers;
ParserCollection parsers_;
};
diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc
index 072c7c1..5eacb7f 100644
--- a/src/bin/dhcp4/dhcp4_srv.cc
+++ b/src/bin/dhcp4/dhcp4_srv.cc
@@ -42,6 +42,18 @@ using namespace isc::dhcp;
using namespace isc::log;
using namespace std;
+namespace isc {
+namespace dhcp {
+
+/// @brief file name of a server-id file
+///
+/// Server must store its server identifier in persistent storage that must not
+/// change between restarts. This is name of the file that is created in dataDir
+/// (see isc::dhcp::CfgMgr::getDataDir()). It is a text file that uses
+/// regular IPv4 address, e.g. 192.0.2.1. Server will create it during
+/// first run and then use it afterwards.
+static const char* SERVER_ID_FILE = "b10-dhcp4-serverid";
+
// These are hardcoded parameters. Currently this is a skeleton server that only
// grants those options and a single, fixed, hardcoded lease.
@@ -717,3 +729,6 @@ Dhcpv4Srv::sanityCheck(const Pkt4Ptr& pkt, RequirementLevel serverid) {
;
}
}
+
+} // namespace dhcp
+} // namespace isc
diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h
index cb9581f..1c988b1 100644
--- a/src/bin/dhcp4/dhcp4_srv.h
+++ b/src/bin/dhcp4/dhcp4_srv.h
@@ -28,15 +28,6 @@
namespace isc {
namespace dhcp {
-/// @brief file name of a server-id file
-///
-/// Server must store its server identifier in persistent storage that must not
-/// change between restarts. This is name of the file that is created in dataDir
-/// (see isc::dhcp::CfgMgr::getDataDir()). It is a text file that uses
-/// regular IPv4 address, e.g. 192.0.2.1. Server will create it during
-/// first run and then use it afterwards.
-static const char* SERVER_ID_FILE = "b10-dhcp4-serverid";
-
/// @brief DHCPv4 server service.
///
/// This singleton class represents DHCPv4 server. It contains all
diff --git a/src/bin/dhcp4/tests/Makefile.am b/src/bin/dhcp4/tests/Makefile.am
index 86a47dd..73bf00b 100644
--- a/src/bin/dhcp4/tests/Makefile.am
+++ b/src/bin/dhcp4/tests/Makefile.am
@@ -34,6 +34,10 @@ AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
CLEANFILES = $(builddir)/interfaces.txt $(builddir)/logger_lockfile
AM_CXXFLAGS = $(B10_CXXFLAGS)
+if USE_CLANGPP
+# Disable unused parameter warning caused by some Boost headers when compiling with clang
+AM_CXXFLAGS += -Wno-unused-parameter
+endif
if USE_STATIC_LINK
AM_LDFLAGS = -static
diff --git a/src/bin/dhcp6/Makefile.am b/src/bin/dhcp6/Makefile.am
index 735934b..3b07510 100644
--- a/src/bin/dhcp6/Makefile.am
+++ b/src/bin/dhcp6/Makefile.am
@@ -6,6 +6,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/lib/cc -I$(top_builddir)/src/lib/cc
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(B10_CXXFLAGS)
+if USE_CLANGPP
+# Disable unused parameter warning caused by some Boost headers when compiling with clang
+AM_CXXFLAGS += -Wno-unused-parameter
+endif
if USE_STATIC_LINK
AM_LDFLAGS = -static
diff --git a/src/bin/dhcp6/config_parser.cc b/src/bin/dhcp6/config_parser.cc
index 665e684..76ed228 100644
--- a/src/bin/dhcp6/config_parser.cc
+++ b/src/bin/dhcp6/config_parser.cc
@@ -996,13 +996,13 @@ public:
return (new OptionDataListParser(param_name));
}
+ /// Pointer to options instances storage.
+ OptionStorage* options_;
/// Intermediate option storage. This storage is used by
/// lower level parsers to add new options. Values held
/// in this storage are assigned to main storage (options_)
/// if overall parsing was successful.
OptionStorage local_options_;
- /// Pointer to options instances storage.
- OptionStorage* options_;
/// Collection of parsers;
ParserCollection parsers_;
};
diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc
index 9a4a534..dd9b23b 100644
--- a/src/bin/dhcp6/dhcp6_srv.cc
+++ b/src/bin/dhcp6/dhcp6_srv.cc
@@ -56,6 +56,16 @@ using namespace std;
namespace isc {
namespace dhcp {
+/// @brief file name of a server-id file
+///
+/// Server must store its duid in persistent storage that must not change
+/// between restarts. This is name of the file that is created in dataDir
+/// (see isc::dhcp::CfgMgr::getDataDir()). It is a text file that uses
+/// double digit hex values separated by colons format, e.g.
+/// 01:ff:02:03:06:80:90:ab:cd:ef. Server will create it during first
+/// run and then use it afterwards.
+static const char* SERVER_DUID_FILE = "b10-dhcp6-serverid";
+
Dhcpv6Srv::Dhcpv6Srv(uint16_t port)
: alloc_engine_(), serverid_(), shutdown_(true) {
diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h
index 7c6f77b..bdcb560 100644
--- a/src/bin/dhcp6/dhcp6_srv.h
+++ b/src/bin/dhcp6/dhcp6_srv.h
@@ -31,16 +31,6 @@
namespace isc {
namespace dhcp {
-/// @brief file name of a server-id file
-///
-/// Server must store its duid in persistent storage that must not change
-/// between restarts. This is name of the file that is created in dataDir
-/// (see isc::dhcp::CfgMgr::getDataDir()). It is a text file that uses
-/// double digit hex values separated by colons format, e.g.
-/// 01:ff:02:03:06:80:90:ab:cd:ef. Server will create it during first
-/// run and then use it afterwards.
-static const char* SERVER_DUID_FILE = "b10-dhcp6-serverid";
-
/// @brief DHCPv6 server service.
///
/// This class represents DHCPv6 server. It contains all
diff --git a/src/bin/dhcp6/tests/Makefile.am b/src/bin/dhcp6/tests/Makefile.am
index 1d139dc..feb4bfa 100644
--- a/src/bin/dhcp6/tests/Makefile.am
+++ b/src/bin/dhcp6/tests/Makefile.am
@@ -30,6 +30,10 @@ AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
CLEANFILES = $(builddir)/interfaces.txt $(builddir)/logger_lockfile
AM_CXXFLAGS = $(B10_CXXFLAGS)
+if USE_CLANGPP
+# Disable unused parameter warning caused by some Boost headers when compiling with clang
+AM_CXXFLAGS += -Wno-unused-parameter
+endif
if USE_STATIC_LINK
AM_LDFLAGS = -static
diff --git a/src/bin/dhcp6/tests/config_parser_unittest.cc b/src/bin/dhcp6/tests/config_parser_unittest.cc
index 158ad62..4430cb2 100644
--- a/src/bin/dhcp6/tests/config_parser_unittest.cc
+++ b/src/bin/dhcp6/tests/config_parser_unittest.cc
@@ -277,9 +277,9 @@ public:
expected_data_len));
}
+ int rcode_;
Dhcpv6Srv srv_;
- int rcode_;
ConstElementPtr comment_;
string valid_iface_;
More information about the bind10-changes
mailing list