Fix several "defined but not used" warnings with gcc-5
GCC 5 is able to prove that in some translation units the static Logger
instance is defined but never used, and generates an unused variable
warning for each one of them. These warnings become fatal errors when
building in debug mode, due to -Werror.
Silence the compiler by not declaring the unused variables.
refs #2767
Change-Id: Icacc579d917d660582221ef090954ec827f46149
diff --git a/core/config-file.cpp b/core/config-file.cpp
index 1079666..a6861e3 100644
--- a/core/config-file.cpp
+++ b/core/config-file.cpp
@@ -30,8 +30,6 @@
namespace nfd {
-NFD_LOG_INIT("ConfigFile");
-
void
ConfigFile::throwErrorOnUnknownSection(const std::string& filename,
const std::string& sectionName,
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index 7c2d2f7..c422b3d 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -31,8 +31,6 @@
namespace nfd {
-NFD_LOG_INIT("EthernetFactory");
-
shared_ptr<EthernetFace>
EthernetFactory::createMulticastFace(const NetworkInterfaceInfo& interface,
const ethernet::Address &address)
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index d4c8d3f..5fbdf25 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.cpp
@@ -29,8 +29,6 @@
using namespace boost::asio;
-NFD_LOG_INIT("WebSocketFactory");
-
WebSocketFactory::WebSocketFactory(const std::string& defaultPort)
: m_defaultPort(defaultPort)
{
diff --git a/daemon/mgmt/channel-status-publisher.cpp b/daemon/mgmt/channel-status-publisher.cpp
index 8abe2fb..bb14879 100644
--- a/daemon/mgmt/channel-status-publisher.cpp
+++ b/daemon/mgmt/channel-status-publisher.cpp
@@ -24,8 +24,6 @@
*/
#include "channel-status-publisher.hpp"
-
-#include "core/logger.hpp"
#include "face/protocol-factory.hpp"
#include "face/channel.hpp"
@@ -33,9 +31,6 @@
namespace nfd {
-NFD_LOG_INIT("ChannelStatusPublisher");
-
-
ChannelStatusPublisher::ChannelStatusPublisher(const FactoryMap& factories,
AppFace& face,
const Name& prefix,
@@ -43,13 +38,10 @@
: SegmentPublisher(face, prefix, keyChain)
, m_factories(factories)
{
-
}
-
ChannelStatusPublisher::~ChannelStatusPublisher()
{
-
}
size_t
diff --git a/daemon/mgmt/face-query-status-publisher.cpp b/daemon/mgmt/face-query-status-publisher.cpp
index d208087..59cf513 100644
--- a/daemon/mgmt/face-query-status-publisher.cpp
+++ b/daemon/mgmt/face-query-status-publisher.cpp
@@ -24,16 +24,12 @@
**/
#include "face-query-status-publisher.hpp"
-#include "core/logger.hpp"
-#include <boost/range/adaptor/reversed.hpp>
+#include <boost/range/adaptor/reversed.hpp>
#include <ndn-cxx/management/nfd-face-status.hpp>
namespace nfd {
-NFD_LOG_INIT("FaceQueryStatusPublisher");
-
-
FaceQueryStatusPublisher::FaceQueryStatusPublisher(const FaceTable& faceTable,
AppFace& face,
const Name& prefix,
diff --git a/daemon/mgmt/face-status-publisher.cpp b/daemon/mgmt/face-status-publisher.cpp
index 759f9ce..ff061fa 100644
--- a/daemon/mgmt/face-status-publisher.cpp
+++ b/daemon/mgmt/face-status-publisher.cpp
@@ -23,17 +23,13 @@
**/
#include "face-status-publisher.hpp"
-#include "core/logger.hpp"
#include "fw/face-table.hpp"
-#include <boost/range/adaptor/reversed.hpp>
+#include <boost/range/adaptor/reversed.hpp>
#include <ndn-cxx/management/nfd-face-status.hpp>
namespace nfd {
-NFD_LOG_INIT("FaceStatusPublisher");
-
-
FaceStatusPublisher::FaceStatusPublisher(const FaceTable& faceTable,
AppFace& face,
const Name& prefix,
@@ -41,13 +37,10 @@
: SegmentPublisher(face, prefix, keyChain)
, m_faceTable(faceTable)
{
-
}
-
FaceStatusPublisher::~FaceStatusPublisher()
{
-
}
size_t
diff --git a/daemon/mgmt/fib-enumeration-publisher.cpp b/daemon/mgmt/fib-enumeration-publisher.cpp
index b7bad51..5123a58 100644
--- a/daemon/mgmt/fib-enumeration-publisher.cpp
+++ b/daemon/mgmt/fib-enumeration-publisher.cpp
@@ -79,9 +79,9 @@
totalLength += fibEntryLength;
}
+
NFD_LOG_DEBUG("generate: Total length = " << totalLength);
return totalLength;
}
-
} // namespace nfd
diff --git a/daemon/mgmt/strategy-choice-publisher.cpp b/daemon/mgmt/strategy-choice-publisher.cpp
index 163ac3a..8db7124 100644
--- a/daemon/mgmt/strategy-choice-publisher.cpp
+++ b/daemon/mgmt/strategy-choice-publisher.cpp
@@ -24,16 +24,12 @@
**/
#include "strategy-choice-publisher.hpp"
-#include "core/logger.hpp"
#include "table/strategy-choice.hpp"
#include <ndn-cxx/management/nfd-strategy-choice.hpp>
namespace nfd {
-NFD_LOG_INIT("StrategyChoicePublisher");
-
-
StrategyChoicePublisher::StrategyChoicePublisher(const StrategyChoice& strategyChoice,
AppFace& face,
const Name& prefix,
@@ -41,12 +37,10 @@
: SegmentPublisher(face, prefix, keyChain)
, m_strategyChoice(strategyChoice)
{
-
}
StrategyChoicePublisher::~StrategyChoicePublisher()
{
-
}
size_t
diff --git a/tests/core/config-file.t.cpp b/tests/core/config-file.t.cpp
index cb01724..15ae377 100644
--- a/tests/core/config-file.t.cpp
+++ b/tests/core/config-file.t.cpp
@@ -33,8 +33,6 @@
namespace nfd {
namespace tests {
-NFD_LOG_INIT("ConfigFileTest");
-
BOOST_FIXTURE_TEST_SUITE(TestConfigFile, BaseFixture)
// a
diff --git a/tests/daemon/mgmt/channel-status-publisher.t.cpp b/tests/daemon/mgmt/channel-status-publisher.t.cpp
index 08fbe67..6027137 100644
--- a/tests/daemon/mgmt/channel-status-publisher.t.cpp
+++ b/tests/daemon/mgmt/channel-status-publisher.t.cpp
@@ -28,9 +28,6 @@
#include "channel-status-common.hpp"
-#include "core/logger.hpp"
-NFD_LOG_INIT("TestChannelStatusPublisher");
-
namespace nfd {
namespace tests {
@@ -91,8 +88,6 @@
ndn::nfd::ChannelStatus entry(*i);
- NFD_LOG_DEBUG("looking for channelstatus " << entry.getLocalUri());
-
std::map<std::string, ndn::nfd::ChannelStatus>::const_iterator expectedEntryPos =
m_expectedEntries.find(entry.getLocalUri());
diff --git a/tests/daemon/mgmt/face-status-publisher.t.cpp b/tests/daemon/mgmt/face-status-publisher.t.cpp
index 0843881..383dba8 100644
--- a/tests/daemon/mgmt/face-status-publisher.t.cpp
+++ b/tests/daemon/mgmt/face-status-publisher.t.cpp
@@ -28,8 +28,6 @@
namespace nfd {
namespace tests {
-NFD_LOG_INIT("FaceStatusPublisherTest");
-
BOOST_FIXTURE_TEST_SUITE(MgmtFaceStatusPublisher, FaceStatusPublisherFixture)
BOOST_AUTO_TEST_CASE(EncodingDecoding)
diff --git a/tests/daemon/mgmt/fib-enumeration-publisher.t.cpp b/tests/daemon/mgmt/fib-enumeration-publisher.t.cpp
index 62ea6a7..34cb582 100644
--- a/tests/daemon/mgmt/fib-enumeration-publisher.t.cpp
+++ b/tests/daemon/mgmt/fib-enumeration-publisher.t.cpp
@@ -38,8 +38,6 @@
namespace nfd {
namespace tests {
-NFD_LOG_INIT("TestFibEnumerationPublisher");
-
BOOST_FIXTURE_TEST_SUITE(MgmtFibEnumerationPublisher, FibEnumerationPublisherFixture)
BOOST_AUTO_TEST_CASE(TestFibEnumerationPublisher)