Browse Source

Merge branch 'trac3172'

Conflicts:
	src/bin/dhcp6/dhcp6_srv.h
Mukund Sivaraman 11 years ago
parent
commit
2696320ef2

+ 0 - 4
src/lib/asiodns/Makefile.am

@@ -38,10 +38,6 @@ EXTRA_DIST = asiodns_messages.mes
 # Note: the ordering matters: -Wno-... must follow -Wextra (defined in
 # B10_CXXFLAGS)
 libb10_asiodns_la_CXXFLAGS = $(AM_CXXFLAGS)
-if USE_CLANGPP
-# Same for clang++, but we need to turn off -Werror completely.
-libb10_asiodns_la_CXXFLAGS += -Wno-error
-endif
 libb10_asiodns_la_CPPFLAGS = $(AM_CPPFLAGS)
 libb10_asiodns_la_LIBADD  = $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 libb10_asiodns_la_LIBADD += $(top_builddir)/src/lib/log/libb10-log.la

+ 0 - 4
src/lib/asiodns/tests/Makefile.am

@@ -44,10 +44,6 @@ run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_GXX
 run_unittests_CXXFLAGS += -Wno-unused-parameter
 endif
-if USE_CLANGPP
-# Same for clang++, but we need to turn off -Werror completely.
-run_unittests_CXXFLAGS += -Wno-error
-endif
 endif
 
 noinst_PROGRAMS = $(TESTS)

+ 0 - 4
src/lib/asiolink/Makefile.am

@@ -37,10 +37,6 @@ libb10_asiolink_la_SOURCES += local_socket.h local_socket.cc
 # Note: the ordering matters: -Wno-... must follow -Wextra (defined in
 # B10_CXXFLAGS)
 libb10_asiolink_la_CXXFLAGS = $(AM_CXXFLAGS)
-if USE_CLANGPP
-# Same for clang++, but we need to turn off -Werror completely.
-libb10_asiolink_la_CXXFLAGS += -Wno-error
-endif
 libb10_asiolink_la_CPPFLAGS = $(AM_CPPFLAGS)
 libb10_asiolink_la_LIBADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
 

+ 3 - 5
src/lib/asiolink/io_asio_socket.h

@@ -344,7 +344,7 @@ public:
     ///
     /// Must be supplied as it is abstract in the base class.
     /// The parameters are unused.
-    virtual void asyncReceive(void* data, size_t, size_t, IOEndpoint*, C&) {
+    virtual void asyncReceive(void*, size_t, size_t, IOEndpoint*, C&) {
     }
 
     /// \brief Checks if the data received is complete.
@@ -357,10 +357,8 @@ public:
     /// \param outbuff Unused.
     ///
     /// \return Always true
-    virtual bool receiveComplete(const void* staging, size_t length,
-                                 size_t& cumulative, size_t& offset,
-                                 size_t& expected,
-                                 isc::util::OutputBufferPtr& outbuff)
+    virtual bool receiveComplete(const void*, size_t, size_t&, size_t&,
+                                 size_t&, isc::util::OutputBufferPtr&)
     {
         return (true);
     }

+ 0 - 4
src/lib/asiolink/tests/Makefile.am

@@ -52,10 +52,6 @@ run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_GXX
 run_unittests_CXXFLAGS += -Wno-unused-parameter
 endif
-if USE_CLANGPP
-# Same for clang++, but we need to turn off -Werror completely.
-run_unittests_CXXFLAGS += -Wno-error
-endif
 endif
 
 noinst_PROGRAMS = $(TESTS)

+ 4 - 4
src/lib/asiolink/tests/io_endpoint_unittest.cc

@@ -41,7 +41,7 @@ TEST(IOEndpointTest, createUDPv4) {
     EXPECT_EQ(53210, ep->getPort());
     EXPECT_EQ(AF_INET, ep->getFamily());
     EXPECT_EQ(AF_INET, ep->getAddress().getFamily());
-    EXPECT_EQ(IPPROTO_UDP, ep->getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_UDP), ep->getProtocol());
 }
 
 TEST(IOEndpointTest, createTCPv4) {
@@ -51,7 +51,7 @@ TEST(IOEndpointTest, createTCPv4) {
     EXPECT_EQ(5301, ep->getPort());
     EXPECT_EQ(AF_INET, ep->getFamily());
     EXPECT_EQ(AF_INET, ep->getAddress().getFamily());
-    EXPECT_EQ(IPPROTO_TCP, ep->getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_TCP), ep->getProtocol());
 }
 
 TEST(IOEndpointTest, createUDPv6) {
@@ -62,7 +62,7 @@ TEST(IOEndpointTest, createUDPv6) {
     EXPECT_EQ(5302, ep->getPort());
     EXPECT_EQ(AF_INET6, ep->getFamily());
     EXPECT_EQ(AF_INET6, ep->getAddress().getFamily());
-    EXPECT_EQ(IPPROTO_UDP, ep->getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_UDP), ep->getProtocol());
 }
 
 TEST(IOEndpointTest, createTCPv6) {
@@ -73,7 +73,7 @@ TEST(IOEndpointTest, createTCPv6) {
     EXPECT_EQ(5303, ep->getPort());
     EXPECT_EQ(AF_INET6, ep->getFamily());
     EXPECT_EQ(AF_INET6, ep->getAddress().getFamily());
-    EXPECT_EQ(IPPROTO_TCP, ep->getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_TCP), ep->getProtocol());
 }
 
 TEST(IOEndpointTest, equality) {

+ 4 - 2
src/lib/asiolink/tests/io_socket_unittest.cc

@@ -23,8 +23,10 @@
 using namespace isc::asiolink;
 
 TEST(IOSocketTest, dummySockets) {
-    EXPECT_EQ(IPPROTO_UDP, IOSocket::getDummyUDPSocket().getProtocol());
-    EXPECT_EQ(IPPROTO_TCP, IOSocket::getDummyTCPSocket().getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_UDP),
+              IOSocket::getDummyUDPSocket().getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_TCP),
+              IOSocket::getDummyTCPSocket().getProtocol());
     EXPECT_EQ(-1, IOSocket::getDummyUDPSocket().getNative());
     EXPECT_EQ(-1, IOSocket::getDummyTCPSocket().getNative());
 }

+ 2 - 2
src/lib/asiolink/tests/tcp_endpoint_unittest.cc

@@ -37,7 +37,7 @@ TEST(TCPEndpointTest, v4Address) {
 
     EXPECT_TRUE(address == endpoint.getAddress());
     EXPECT_EQ(test_port, endpoint.getPort());
-    EXPECT_EQ(IPPROTO_TCP, endpoint.getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_TCP), endpoint.getProtocol());
     EXPECT_EQ(AF_INET, endpoint.getFamily());
 }
 
@@ -50,6 +50,6 @@ TEST(TCPEndpointTest, v6Address) {
 
     EXPECT_TRUE(address == endpoint.getAddress());
     EXPECT_EQ(test_port, endpoint.getPort());
-    EXPECT_EQ(IPPROTO_TCP, endpoint.getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_TCP), endpoint.getProtocol());
     EXPECT_EQ(AF_INET6, endpoint.getFamily());
 }

+ 2 - 2
src/lib/asiolink/tests/udp_endpoint_unittest.cc

@@ -37,7 +37,7 @@ TEST(UDPEndpointTest, v4Address) {
 
     EXPECT_TRUE(address == endpoint.getAddress());
     EXPECT_EQ(test_port, endpoint.getPort());
-    EXPECT_EQ(IPPROTO_UDP, endpoint.getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_UDP), endpoint.getProtocol());
     EXPECT_EQ(AF_INET, endpoint.getFamily());
 }
 
@@ -50,6 +50,6 @@ TEST(UDPEndpointTest, v6Address) {
 
     EXPECT_TRUE(address == endpoint.getAddress());
     EXPECT_EQ(test_port, endpoint.getPort());
-    EXPECT_EQ(IPPROTO_UDP, endpoint.getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_UDP), endpoint.getProtocol());
     EXPECT_EQ(AF_INET6, endpoint.getFamily());
 }

+ 0 - 6
src/lib/cc/Makefile.am

@@ -13,12 +13,6 @@ if USE_GXX
 AM_CXXFLAGS += -Wno-unused-parameter
 AM_CXXFLAGS += -fno-strict-aliasing
 endif
-if USE_CLANGPP
-# Likewise, ASIO header files will trigger various warnings with clang++.
-# Worse, there doesn't seem to be any option to disable one of the warnings
-# in any way, so we need to turn off -Werror.
-AM_CXXFLAGS += -Wno-error
-endif
 
 lib_LTLIBRARIES = libb10-cc.la
 libb10_cc_la_SOURCES = data.cc data.h session.cc session.h

+ 0 - 3
src/lib/cc/tests/Makefile.am

@@ -6,9 +6,6 @@ AM_CXXFLAGS = $(B10_CXXFLAGS)
 if USE_GXX			#XXX: see ../Makefile.am
 AM_CXXFLAGS += -Wno-unused-parameter
 endif
-if USE_CLANGPP
-AM_CXXFLAGS += -Wno-error
-endif
 
 if USE_STATIC_LINK
 AM_LDFLAGS = -static

+ 1 - 1
src/lib/dhcp/tests/protocol_util_unittest.cc

@@ -340,7 +340,7 @@ TEST(ProtocolUtilTest, writeIpUdpHeader) {
 
     // Protocol type is UDP.
     uint8_t proto = in_buf.readUint8();
-    EXPECT_EQ(IPPROTO_UDP, proto);
+    EXPECT_EQ(static_cast<short>(IPPROTO_UDP), proto);
 
     // Check that the checksum is correct. The reference checksum value
     // has been calculated manually.

+ 9 - 9
src/lib/dns/message.cc

@@ -495,7 +495,7 @@ Message::getTSIGRecord() const {
 
 unsigned int
 Message::getRRCount(const Section section) const {
-    if (section >= MessageImpl::NUM_SECTIONS) {
+    if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
         isc_throw(OutOfRange, "Invalid message section: " << section);
     }
     return (impl_->counts_[section]);
@@ -511,7 +511,7 @@ Message::addRRset(const Section section, RRsetPtr rrset) {
         isc_throw(InvalidMessageOperation,
                   "addRRset performed in non-render mode");
     }
-    if (section >= MessageImpl::NUM_SECTIONS) {
+    if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
         isc_throw(OutOfRange, "Invalid message section: " << section);
     }
 
@@ -524,7 +524,7 @@ bool
 Message::hasRRset(const Section section, const Name& name,
                   const RRClass& rrclass, const RRType& rrtype)
 {
-    if (section >= MessageImpl::NUM_SECTIONS) {
+    if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
         isc_throw(OutOfRange, "Invalid message section: " << section);
     }
 
@@ -546,7 +546,7 @@ Message::hasRRset(const Section section, const RRsetPtr& rrset) {
 
 bool
 Message::removeRRset(const Section section, RRsetIterator& iterator) {
-    if (section >= MessageImpl::NUM_SECTIONS) {
+    if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
         isc_throw(OutOfRange, "Invalid message section: " << section);
     }
 
@@ -575,7 +575,7 @@ Message::clearSection(const Section section) {
         isc_throw(InvalidMessageOperation,
                   "clearSection performed in non-render mode");
     }
-    if (section >= MessageImpl::NUM_SECTIONS) {
+    if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
         isc_throw(OutOfRange, "Invalid message section: " << section);
     }
     if (section == Message::SECTION_QUESTION) {
@@ -732,7 +732,7 @@ int
 MessageImpl::parseSection(const Message::Section section,
                           InputBuffer& buffer, Message::ParseOptions options)
 {
-    assert(section < MessageImpl::NUM_SECTIONS);
+    assert(static_cast<int>(section) < MessageImpl::NUM_SECTIONS);
 
     unsigned int added = 0;
 
@@ -984,7 +984,7 @@ Message::clear(Mode mode) {
 
 void
 Message::appendSection(const Section section, const Message& source) {
-    if (section >= MessageImpl::NUM_SECTIONS) {
+    if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
         isc_throw(OutOfRange, "Invalid message section: " << section);
     }
 
@@ -1130,7 +1130,7 @@ Message::endQuestion() const {
 ///
 const SectionIterator<RRsetPtr>
 Message::beginSection(const Section section) const {
-    if (section >= MessageImpl::NUM_SECTIONS) {
+    if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
         isc_throw(OutOfRange, "Invalid message section: " << section);
     }
     if (section == SECTION_QUESTION) {
@@ -1143,7 +1143,7 @@ Message::beginSection(const Section section) const {
 
 const SectionIterator<RRsetPtr>
 Message::endSection(const Section section) const {
-    if (section >= MessageImpl::NUM_SECTIONS) {
+    if (static_cast<int>(section) >= MessageImpl::NUM_SECTIONS) {
         isc_throw(OutOfRange, "Invalid message section: " << section);
     }
     if (section == SECTION_QUESTION) {

+ 0 - 4
src/lib/log/Makefile.am

@@ -42,10 +42,6 @@ libb10_log_la_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_GXX
 libb10_log_la_CXXFLAGS += -Wno-unused-parameter
 endif
-if USE_CLANGPP
-# Same for clang++, but we need to turn off -Werror completely.
-libb10_log_la_CXXFLAGS += -Wno-error
-endif
 libb10_log_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
 libb10_log_la_LIBADD   = $(top_builddir)/src/lib/util/libb10-util.la
 libb10_log_la_LIBADD  += interprocess/libb10-log_interprocess.la

+ 0 - 4
src/lib/resolve/Makefile.am

@@ -46,8 +46,4 @@ EXTRA_DIST = resolve_messages.mes
 # Note: the ordering matters: -Wno-... must follow -Wextra (defined in
 # B10_CXXFLAGS)
 libb10_resolve_la_CXXFLAGS = $(AM_CXXFLAGS)
-if USE_CLANGPP
-# For clang++, we need to turn off -Werror completely.
-libb10_resolve_la_CXXFLAGS += -Wno-error
-endif
 libb10_resolve_la_CPPFLAGS = $(AM_CPPFLAGS)

+ 4 - 2
src/lib/server_common/tests/client_unittest.cc

@@ -63,7 +63,8 @@ protected:
 
 TEST_F(ClientTest, constructIPv4) {
     EXPECT_EQ(AF_INET, client4->getRequestSourceEndpoint().getFamily());
-    EXPECT_EQ(IPPROTO_UDP, client4->getRequestSourceEndpoint().getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_UDP),
+              client4->getRequestSourceEndpoint().getProtocol());
     EXPECT_EQ("192.0.2.1",
               client4->getRequestSourceEndpoint().getAddress().toText());
     EXPECT_EQ(53214, client4->getRequestSourceEndpoint().getPort());
@@ -77,7 +78,8 @@ TEST_F(ClientTest, constructIPv4) {
 
 TEST_F(ClientTest, constructIPv6) {
     EXPECT_EQ(AF_INET6, client6->getRequestSourceEndpoint().getFamily());
-    EXPECT_EQ(IPPROTO_TCP, client6->getRequestSourceEndpoint().getProtocol());
+    EXPECT_EQ(static_cast<short>(IPPROTO_TCP),
+              client6->getRequestSourceEndpoint().getProtocol());
     EXPECT_EQ("2001:db8::1",
               client6->getRequestSourceEndpoint().getAddress().toText());
     EXPECT_EQ(53216, client6->getRequestSourceEndpoint().getPort());

+ 0 - 4
src/lib/statistics/tests/Makefile.am

@@ -40,10 +40,6 @@ run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
 if USE_GXX
 run_unittests_CXXFLAGS += -Wno-unused-parameter
 endif
-if USE_CLANGPP
-# Same for clang++, but we need to turn off -Werror completely.
-run_unittests_CXXFLAGS += -Wno-error
-endif
 endif
 
 noinst_PROGRAMS = $(TESTS)

+ 2 - 4
src/lib/xfr/Makefile.am

@@ -5,10 +5,8 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
 AM_CPPFLAGS += $(BOOST_INCLUDES)
 
 AM_CXXFLAGS = $(B10_CXXFLAGS)
-AM_CXXFLAGS += -Wno-unused-parameter # see src/lib/cc/Makefile.am
-if USE_CLANGPP
-AM_CXXFLAGS += -Wno-error
-endif
+AM_CXXFLAGS += -Wno-unused-parameter
+# see src/lib/cc/Makefile.am
 
 CLEANFILES = *.gcno *.gcda
 

+ 0 - 3
tests/tools/badpacket/Makefile.am

@@ -21,9 +21,6 @@ badpacket_SOURCES += scan.cc scan.h
 badpacket_SOURCES += version.h
 
 badpacket_CXXFLAGS = $(AM_CXXFLAGS)
-if USE_CLANGPP
-badpacket_CXXFLAGS += -Wno-error
-endif
 
 badpacket_LDADD  = $(top_builddir)/src/lib/asiodns/libb10-asiodns.la
 badpacket_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la