Add compiler warning flags and fix compile warning 52/61752/3
authorseong.chung <seong.chung@samsung.com>
Thu, 10 Mar 2016 09:01:07 +0000 (18:01 +0900)
committerSeongwook Chung <seong.chung@samsung.com>
Thu, 10 Mar 2016 09:10:09 +0000 (01:10 -0800)
[Problem]
In case of adding compiler warning, there is one build error in class NetherCynaraBackend

The order of member variable between cynaraConfig and cynaraResult in class declaration is different from order of enumeration in constructor

* class declaration
class NetherCynaraBackend : public NetherPolicyBackend
{
   ....
   private:
   ....

          cynara_async_configuration *cynaraConfig;
          std::vector<u_int32_t> responseQueue;
          int cynaraResult;
}

* constructor
NetherCynaraBackend::NetherCynaraBackend(const NetherConfig &netherConfig)
             : NetherPolicyBackend(netherConfig), currentCynaraDescriptor(0),
             cynaraLastResult(CYNARA_API_UNKNOWN_ERROR), CynaraConfig(nullptr)

[Fix]
Change order between cynaraResult and cynaraConfig of class declaration

Change-Id: Ia03b10a33ee6b025ee28d76b82035e8f9cfb68d1
Signed-off-by: seong.chung <seong.chung@samsung.com>
CMakeLists.txt
include/nether_CynaraBackend.h

index ff080b6..dff3af0 100644 (file)
 CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
 PROJECT (nether)
 INCLUDE (FindPkgConfig)
+
+# Set compiler warning flags
+ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
+ADD_DEFINITIONS("-Wall")                        # Generate all warnings
+ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
+
 IF (CMAKE_BUILD_TYPE MATCHES DEBUG)
        SET (CMAKE_CXX_FLAGS "-g -Wall -Wextra -std=c++11")
 ELSE ()
@@ -35,5 +41,6 @@ IF (NOT DEFINED SYSTEMD_UNIT_DIR)
        SET(SYSTEMD_UNIT_DIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system")
 ENDIF (NOT DEFINED SYSTEMD_UNIT_DIR)
 
+
 ADD_SUBDIRECTORY (src)
 ADD_SUBDIRECTORY (conf)
index 4dd52b1..d0ba8c0 100644 (file)
@@ -58,9 +58,9 @@ class NetherCynaraBackend : public NetherPolicyBackend
                cynara_async *cynaraContext;
                NetherDescriptorStatus currentCynaraDescriptorStatus;
                int currentCynaraDescriptor;
+               int cynaraLastResult;
                cynara_async_configuration *cynaraConfig;
                std::vector<u_int32_t> responseQueue;
-               int cynaraLastResult;
 };
 
 #endif // HAVE_CYNARA