build: Enabling -Werror in debug mode and updating behavior of CXXFLAGS overriding

Change-Id: Ieee3ad85bf0e3eb283b2d42a6df8d3942cf11a51
diff --git a/src/nrd.cpp b/src/nrd.cpp
index 239f940..bad2265 100644
--- a/src/nrd.cpp
+++ b/src/nrd.cpp
@@ -35,7 +35,7 @@
   };
 
 void
-Nrd::setInterestFilterFailed(const Name& name, const std::string& msg) 
+Nrd::setInterestFilterFailed(const Name& name, const std::string& msg)
 {
   std::cerr << "Error in setting interest filter (" << name << "): " << msg << std::endl;
   m_face.shutdown();
@@ -47,14 +47,14 @@
                    COMMAND_VERBS + (sizeof(COMMAND_VERBS) / sizeof(VerbAndProcessor)))
 {
   //check whether the components of localhop and localhost prefixes are same
-  BOOST_ASSERT(COMMAND_PREFIX.size() == REMOTE_COMMAND_PREFIX.size ()); 
+  BOOST_ASSERT(COMMAND_PREFIX.size() == REMOTE_COMMAND_PREFIX.size());
 
   std::cerr << "Setting interest filter on: " << COMMAND_PREFIX.toUri() << std::endl;
   m_face.setController(m_nfdController);
   m_face.setInterestFilter(COMMAND_PREFIX.toUri(),
                            bind(&Nrd::onRibRequest, this, _2),
                            bind(&Nrd::setInterestFilterFailed, this, _1, _2));
-  
+
   std::cerr << "Setting interest filter on: " << REMOTE_COMMAND_PREFIX.toUri() << std::endl;
   m_face.setInterestFilter(REMOTE_COMMAND_PREFIX.toUri(),
                            bind(&Nrd::onRibRequest, this, _2),
@@ -105,7 +105,7 @@
       return;
     }
 
-  //REMOTE_COMMAND_PREFIX number of componenets are same as 
+  //REMOTE_COMMAND_PREFIX number of componenets are same as
   // NRD_COMMAND_PREFIX's so no extra checks are required.
   const Name::Component& verb = command.get(COMMAND_PREFIX.size());
   VerbDispatchTable::const_iterator verbProcessor = m_verbDispatch.find(verb);
@@ -127,7 +127,7 @@
         }
 
       // \todo add proper log support
-      std::cout << "Received options (name, faceid, cost): " << options.getName() << 
+      std::cout << "Received options (name, faceid, cost): " << options.getName() <<
                    ", " << options.getFaceId() << ", "  << options.getCost() << std::endl;
 
       nfd::ControlResponse response;
@@ -143,8 +143,8 @@
 Nrd::extractOptions(const Interest& request,
                     PrefixRegOptions& extractedOptions)
 {
-  const Name& command = request.getName();
-  //REMOTE_COMMAND_PREFIX is same in size of NRD_COMMAND_PREFIX 
+  // const Name& command = request.getName();
+  //REMOTE_COMMAND_PREFIX is same in size of NRD_COMMAND_PREFIX
   //so no extra processing is required.
   const size_t optionCompIndex = COMMAND_PREFIX.size() + 1;
 
@@ -167,15 +167,15 @@
 }
 
 void
-Nrd::onCommandError(const std::string& error, 
-                    const Interest& request, 
+Nrd::onCommandError(const std::string& error,
+                    const Interest& request,
                     const PrefixRegOptions& options)
 {
   nfd::ControlResponse response;
-  
+
   response.setCode(400);
   response.setText(error);
-  
+
   std::cout << "Error: " << error << std::endl;
   sendResponse(request.getName(), response);
   m_managedRib.erase(options);
@@ -185,13 +185,13 @@
 Nrd::onUnRegSuccess(const Interest& request, const PrefixRegOptions& options)
 {
   nfd::ControlResponse response;
-  
+
   response.setCode(200);
   response.setText("Success");
   response.setBody(options.wireEncode());
- 
-  std::cout << "Success: Name unregistered (" << 
-                options.getName() << ", " << 
+
+  std::cout << "Success: Name unregistered (" <<
+                options.getName() << ", " <<
                 options.getFaceId() << ")" << std::endl;
   sendResponse(request.getName(), response);
   m_managedRib.erase(options);
@@ -201,12 +201,12 @@
 Nrd::onRegSuccess(const Interest& request, const PrefixRegOptions& options)
 {
   nfd::ControlResponse response;
-  
+
   response.setCode(200);
   response.setText("Success");
   response.setBody(options.wireEncode());
-  
-  std::cout << "Success: Name registered (" << options.getName() << ", " << 
+
+  std::cout << "Success: Name registered (" << options.getName() << ", " <<
                                                options.getFaceId() << ")" << std::endl;
   sendResponse(request.getName(), response);
 }
@@ -265,7 +265,7 @@
 {
   Name enable("/localhost/nfd/control-header/in-faceid/enable");
   Interest enableCommand(enable);
- 
+
   m_keyChain.sign(enableCommand);
   m_face.expressInterest(enableCommand,
                          ndn::bind(&Nrd::onControlHeaderSuccess, this),