celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject celix git commit: CELIX-386: Updates compiler flags and fixes resulting warnings
Date Thu, 08 Jun 2017 15:09:37 GMT
Repository: celix
Updated Branches:
  refs/heads/develop b8b16fd67 -> de2369c67


CELIX-386: Updates compiler flags and fixes resulting warnings


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/de2369c6
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/de2369c6
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/de2369c6

Branch: refs/heads/develop
Commit: de2369c67e0183f6bc06628d649259c5937048fc
Parents: b8b16fd
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Thu Jun 8 17:15:10 2017 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Thu Jun 8 17:15:10 2017 +0200

----------------------------------------------------------------------
 CMakeLists.txt                                  | 20 ++++++++------------
 cmake/FindCELIX.cmake                           | 10 +---------
 .../include/celix/dm/ServiceDependency_Impl.h   | 12 ++++++------
 dfi/CMakeLists.txt                              |  1 -
 examples/dm_example_cxx/phase1/CMakeLists.txt   |  2 ++
 .../phase1/src/Phase1Activator.cc               |  4 ++--
 examples/dm_example_cxx/phase1/src/Phase1Cmp.cc |  2 +-
 examples/dm_example_cxx/phase2a/CMakeLists.txt  |  1 +
 examples/dm_example_cxx/phase2b/CMakeLists.txt  |  2 ++
 examples/dm_example_cxx/phase3/CMakeLists.txt   |  1 +
 examples/dm_example_cxx/phase3/src/Phase3Cmp.cc |  4 ++--
 .../phase3_locking/CMakeLists.txt               |  2 ++
 .../phase3_locking/src/Phase3LockingCmp.cc      |  2 +-
 .../services_example_cxx/bar/CMakeLists.txt     |  2 ++
 .../services_example_cxx/baz/CMakeLists.txt     |  2 ++
 .../services_example_cxx/foo/CMakeLists.txt     |  6 ++++--
 framework/private/src/bundle_archive.c          |  2 +-
 framework/private/src/bundle_revision.c         | 10 ++++------
 framework/private/src/celix_errorcodes.c        |  3 +--
 launcher/private/src/celix_test_runner.cpp      |  4 ++--
 utils/private/test/celix_threads_test.cpp       |  2 +-
 21 files changed, 46 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f169304..ebccf06 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -34,23 +34,19 @@ ENDIF()
 
 IF (ANDROID)
     SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall ${CMAKE_C_FLAGS}")
-ENDIF()
-IF(UNIX AND NOT ANDROID)
-    SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -Werror -fPIC ${CMAKE_C_FLAGS}")
-    SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") #TODO enable -Wall -Werror ->
warning in cpputest
+ELSE ()
+    SET(CMAKE_C_FLAGS "-std=c99 -Wall -Werror -fPIC ${CMAKE_C_FLAGS}") #TODO add -Wextra
+    SET(CMAKE_CXX_FLAGS "-std=c++11") #TODO -Wall -Wextra -Werror does not yet work with
the unit tests
     SET(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG")
     SET(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG")
 ENDIF()
-IF(UNIX AND NOT APPLE) 
-	SET(CMAKE_C_FLAGS "-pthread ${CMAKE_C_FLAGS}")
-    set(CMAKE_CXX_FLAGS "-pthread ${CMAKE_CXX_FLAGS}")
-    set(CMAKE_EXE_LINKER_FLAGS "-pthread ${CMAKE_EXE_LINKER_FLAGS}")
-ENDIF()
-IF(WIN32)
-	SET(CMAKE_C_FLAGS "-D_CRT_SECURE_NO_WARNINGS ${CMAKE_C_FLAGS}")
-ENDIF()
+
 IF(APPLE)
     set(CMAKE_MACOSX_RPATH 1)
+ELSE ()
+    set(CMAKE_C_FLAGS "-pthread ${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-pthread ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_EXE_LINKER_FLAGS "-pthread ${CMAKE_EXE_LINKER_FLAGS}")
 ENDIF()
 
 # Set version for the framework package/release

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/cmake/FindCELIX.cmake
----------------------------------------------------------------------
diff --git a/cmake/FindCELIX.cmake b/cmake/FindCELIX.cmake
index 1ddb1ca..fc7a96e 100644
--- a/cmake/FindCELIX.cmake
+++ b/cmake/FindCELIX.cmake
@@ -74,17 +74,9 @@ find_library(CELIX_DM_STATIC_LIB NAMES dependency_manager_static
 )
 if (CELIX_DM_STATIC_LIB)
     set(CELIX_DM_INCLUDE_DIR ${CELIX_INCLUDE_DIR}/dependency_manager)
-else()
-    set(CELIX_DM_INCLUDE_DIR )
-endif()
-
-find_library(CELIX_DM_CXX_STATIC_LIB NAMES dependency_manager_cxx_static
-		PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local
-		PATH_SUFFIXES lib lib64
-)
-if (CELIX_DM_CXX_STATIC_LIB)
     set(CELIX_DM_CXX_INCLUDE_DIR ${CELIX_INCLUDE_DIR}/dependency_manager_cxx)
 else()
+    set(CELIX_DM_INCLUDE_DIR )
     set(CELIX_DM_CXX_INCLUDE_DIR )
 endif()
 

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h
----------------------------------------------------------------------
diff --git a/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h b/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h
index 6ff695f..79b89b7 100644
--- a/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h
+++ b/dependency_manager_cxx/include/celix/dm/ServiceDependency_Impl.h
@@ -105,7 +105,7 @@ CServiceDependency<T,I>& CServiceDependency<T,I>::setStrategy(DependencyUpdateSt
 //set callbacks
 template<class T, typename I>
 CServiceDependency<T,I>& CServiceDependency<T,I>::setCallbacks(void (T::*set)(const
I* service)) {
-    this->setCallbacks([this, set](const I* service, Properties&& properties)
{
+    this->setCallbacks([this, set](const I* service, Properties&& __attribute__((unused))
properties) {
         T *cmp = this->componentInstance;
         (cmp->*set)(service);
     });
@@ -134,11 +134,11 @@ CServiceDependency<T,I>& CServiceDependency<T,I>::setCallbacks(
         void (T::*add)(const I* service),
         void (T::*remove)(const I* service)) {
     this->setCallbacks(
-		    [this, add](const I* service, Properties&& properties) {
+		    [this, add](const I* service, Properties&& __attribute__((unused)) properties)
{
 			    T *cmp = this->componentInstance;
 			    (cmp->*add)(service);
 		    },
-		    [this, remove](const I* service, Properties&& properties) {
+		    [this, remove](const I* service, Properties&& __attribute__((unused)) properties)
{
 			    T *cmp = this->componentInstance;
 			    (cmp->*remove)(service);
 		    }
@@ -327,7 +327,7 @@ ServiceDependency<T,I>& ServiceDependency<T,I>::setAddLanguageFilter(bool
addLan
 //set callbacks
 template<class T, class I>
 ServiceDependency<T,I>& ServiceDependency<T,I>::setCallbacks(void (T::*set)(I*
service)) {
-    this->setCallbacks([this, set](I* srv, Properties&& props) {
+    this->setCallbacks([this, set](I* srv, Properties&& __attribute__((unused))
props) {
         T *cmp = this->componentInstance;
         (cmp->*set)(srv);
     });
@@ -356,11 +356,11 @@ ServiceDependency<T,I>& ServiceDependency<T,I>::setCallbacks(
         void (T::*add)(I* service),
         void (T::*remove)(I* service)) {
     this->setCallbacks(
-	    [this, add](I* srv, Properties&& props) {
+	    [this, add](I* srv, Properties&& __attribute__((unused)) props) {
         	T *cmp = this->componentInstance;
         	(cmp->*add)(srv);
     	    },
-	    [this, remove](I* srv, Properties&& props) {
+	    [this, remove](I* srv, Properties&& __attribute__((unused)) props) {
         	T *cmp = this->componentInstance;
         	(cmp->*remove)(srv);
     	    }

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/dfi/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/dfi/CMakeLists.txt b/dfi/CMakeLists.txt
index c672f94..3fd196b 100644
--- a/dfi/CMakeLists.txt
+++ b/dfi/CMakeLists.txt
@@ -70,7 +70,6 @@ if (ENABLE_TESTING)
 	SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) #TODO needed?
     SET(CMAKE_INSTALL_RPATH "${PROJECT_BINARY_DIR}/dfi" "${PROJECT_BINARY_DIR}/utils")
 
-
 	add_executable(test_dfi
 		private/test/dyn_type_tests.cpp
 		private/test/dyn_function_tests.cpp

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase1/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase1/CMakeLists.txt b/examples/dm_example_cxx/phase1/CMakeLists.txt
index 2f476c8..845f2ed 100644
--- a/examples/dm_example_cxx/phase1/CMakeLists.txt
+++ b/examples/dm_example_cxx/phase1/CMakeLists.txt
@@ -28,6 +28,8 @@ add_bundle(phase1_cxx
         src/Phase1Cmp.cc
 )
 
+target_compile_options(phase1_cxx PUBLIC -Wall -Wextra -Weffc++ -Werror)
+
 IF(APPLE)
     target_link_libraries(phase1_cxx celix_framework -Wl,-all_load dependency_manager_static)
 else()

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase1/src/Phase1Activator.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase1/src/Phase1Activator.cc b/examples/dm_example_cxx/phase1/src/Phase1Activator.cc
index 6eb9d0d..a7e74d1 100644
--- a/examples/dm_example_cxx/phase1/src/Phase1Activator.cc
+++ b/examples/dm_example_cxx/phase1/src/Phase1Activator.cc
@@ -35,8 +35,8 @@ DmActivator* DmActivator::create(DependencyManager& mng) {
 struct InvalidCServ {
     void* handle; //valid pod
     int (*foo)(double arg); //still valid pod
-    void bar(double arg) {} //still valid pod
-    virtual void baz(double arg) {} //not a valid pod
+    void bar(double __attribute__((unused)) arg) {} //still valid pod
+    virtual void baz(double __attribute__((unused)) arg) {} //not a valid pod
 };
 
 void Phase1Activator::init() {

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase1/src/Phase1Cmp.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase1/src/Phase1Cmp.cc b/examples/dm_example_cxx/phase1/src/Phase1Cmp.cc
index 3d05a85..4ac0ee8 100644
--- a/examples/dm_example_cxx/phase1/src/Phase1Cmp.cc
+++ b/examples/dm_example_cxx/phase1/src/Phase1Cmp.cc
@@ -47,7 +47,7 @@ std::string Phase1Cmp::getName() {
     return std::string {"IPhase"};
 }
 
-int Phase1Cmp::infoCmd(char * line, FILE *out, FILE *err) {
+int Phase1Cmp::infoCmd(char * __attribute__((unused)) line, FILE *out, FILE __attribute__((unused))
*err) {
     fprintf(out, "Phase1: number of getData calls: %u\n", counter);
     return 0;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase2a/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase2a/CMakeLists.txt b/examples/dm_example_cxx/phase2a/CMakeLists.txt
index cccbba9..3b6b49c 100644
--- a/examples/dm_example_cxx/phase2a/CMakeLists.txt
+++ b/examples/dm_example_cxx/phase2a/CMakeLists.txt
@@ -28,6 +28,7 @@ add_bundle(phase2a_cxx
         src/Phase2aCmp.cc
 )
 
+target_compile_options(phase2a_cxx PUBLIC -Wall -Wextra -Weffc++ -Werror)
 
 IF(APPLE)
     target_link_libraries(phase2a_cxx celix_framework -Wl,-all_load dependency_manager_static)

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase2b/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase2b/CMakeLists.txt b/examples/dm_example_cxx/phase2b/CMakeLists.txt
index 7b2beb1..acaeb65 100644
--- a/examples/dm_example_cxx/phase2b/CMakeLists.txt
+++ b/examples/dm_example_cxx/phase2b/CMakeLists.txt
@@ -29,6 +29,8 @@ add_bundle(phase2b_cxx
         src/Phase2bCmp.cc
 )
 
+target_compile_options(phase2b_cxx PUBLIC -Wall -Wextra -Weffc++ -Werror)
+
 IF(APPLE)
     target_link_libraries(phase2b_cxx celix_framework -Wl,-all_load dependency_manager_static)
 else()

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase3/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3/CMakeLists.txt b/examples/dm_example_cxx/phase3/CMakeLists.txt
index e648f2e..a9e0273 100644
--- a/examples/dm_example_cxx/phase3/CMakeLists.txt
+++ b/examples/dm_example_cxx/phase3/CMakeLists.txt
@@ -28,6 +28,7 @@ add_bundle(phase3_cxx
         src/Phase3Cmp.cc
 )
 
+target_compile_options(phase3_cxx PUBLIC -Wall -Wextra -Weffc++ -Werror)
 
 IF(APPLE)
     target_link_libraries(phase3_cxx celix_framework -Wl,-all_load dependency_manager_static)

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase3/src/Phase3Cmp.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3/src/Phase3Cmp.cc b/examples/dm_example_cxx/phase3/src/Phase3Cmp.cc
index d128337..72fea02 100644
--- a/examples/dm_example_cxx/phase3/src/Phase3Cmp.cc
+++ b/examples/dm_example_cxx/phase3/src/Phase3Cmp.cc
@@ -55,11 +55,11 @@ void Phase3Cmp::addPhase2(IPhase2* phase2, celix::dm::Properties&&
props) {
     this->phases[phase2] = props;
 }
 
-void Phase3Cmp::removePhase2(IPhase2* phase2, celix::dm::Properties&& props) {
+void Phase3Cmp::removePhase2(IPhase2* phase2, celix::dm::Properties&& __attribute__((unused))
props) {
     std::cout << "adding Iphase2 for Phase3Cmp\n";
     this->phases.erase(phase2);
 }
 
-void Phase3Cmp::setPhase2a(IPhase2* phase) {
+void Phase3Cmp::setPhase2a(IPhase2* __attribute__((unused)) phase) {
     std::cout << "setting phase2a\n";
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3_locking/CMakeLists.txt b/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
index ea756ba..f5a5445 100644
--- a/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
+++ b/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
@@ -28,6 +28,8 @@ add_bundle(phase3_locking_cxx
         src/Phase3LockingCmp.cc
 )
 
+target_compile_options(phase3_locking_cxx PUBLIC -Wall -Wextra -Weffc++ -Werror)
+
 IF(APPLE)
     target_link_libraries(phase3_locking_cxx celix_framework -Wl,-all_load dependency_manager_static)
 else()

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc b/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc
index 1d490fd..7827fed 100644
--- a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc
+++ b/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc
@@ -59,7 +59,7 @@ void Phase3LockingCmp::addPhase2(IPhase2* phase2, celix::dm::Properties&&
props)
     this->phases[phase2] = props;
 }
 
-void Phase3LockingCmp::removePhase2(IPhase2* phase2, celix::dm::Properties&& props)
{
+void Phase3LockingCmp::removePhase2(IPhase2* phase2, celix::dm::Properties&& __attribute__((unused))
props) {
     std::cout << "adding Iphase2 for Phase3LockingCmp\n";
     std::lock_guard<std::mutex> lock(mutex);
     this->phases.erase(phase2);

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/services_example_cxx/bar/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/services_example_cxx/bar/CMakeLists.txt b/examples/services_example_cxx/bar/CMakeLists.txt
index 26f2154..05c4d15 100644
--- a/examples/services_example_cxx/bar/CMakeLists.txt
+++ b/examples/services_example_cxx/bar/CMakeLists.txt
@@ -27,6 +27,8 @@ add_bundle(bar_cxx
         private/src/BarActivator.cc
 )
 
+target_compile_options(bar_cxx PUBLIC -Wall -Wextra -Weffc++ -Werror)
+
 IF(APPLE)
     target_link_libraries(bar_cxx celix_framework -Wl,-all_load dependency_manager_static)
 else()

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/services_example_cxx/baz/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/services_example_cxx/baz/CMakeLists.txt b/examples/services_example_cxx/baz/CMakeLists.txt
index 30ce858..eda3830 100644
--- a/examples/services_example_cxx/baz/CMakeLists.txt
+++ b/examples/services_example_cxx/baz/CMakeLists.txt
@@ -27,6 +27,8 @@ add_bundle(baz_cxx
         private/src/BazActivator.cc
 )
 
+target_compile_options(baz_cxx PUBLIC -Wall -Wextra -Weffc++ -Werror)
+
 IF(APPLE)
     target_link_libraries(baz_cxx celix_framework -Wl,-all_load dependency_manager_static)
 else()

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/examples/services_example_cxx/foo/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/services_example_cxx/foo/CMakeLists.txt b/examples/services_example_cxx/foo/CMakeLists.txt
index 6a6a9d8..6c20b3f 100644
--- a/examples/services_example_cxx/foo/CMakeLists.txt
+++ b/examples/services_example_cxx/foo/CMakeLists.txt
@@ -27,8 +27,10 @@ add_bundle(foo_cxx
         private/src/FooActivator.cc
 )
 
+target_compile_options(foo_cxx PUBLIC -Wall -Wextra -Weffc++ -Werror)
+
 IF(APPLE)
-    target_link_libraries(foo_cxx celix_framework -Wl,-all_load dependency_manager_cxx_static)
+    target_link_libraries(foo_cxx celix_framework -Wl,-all_load dependency_manager_static)
 else()
     if(ENABLE_ADDRESS_SANITIZER)
         #With asan there can be undefined symbols
@@ -36,4 +38,4 @@ else()
     else()
         target_link_libraries(foo_cxx -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
     endif()
-endif()
\ No newline at end of file
+endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/framework/private/src/bundle_archive.c
----------------------------------------------------------------------
diff --git a/framework/private/src/bundle_archive.c b/framework/private/src/bundle_archive.c
index 675f0d9..cde727e 100644
--- a/framework/private/src/bundle_archive.c
+++ b/framework/private/src/bundle_archive.c
@@ -26,7 +26,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
+#include <stdio.h>
 #include <time.h>
 #include <sys/stat.h>
 #include <dirent.h>

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/framework/private/src/bundle_revision.c
----------------------------------------------------------------------
diff --git a/framework/private/src/bundle_revision.c b/framework/private/src/bundle_revision.c
index b0d993c..cfa10aa 100644
--- a/framework/private/src/bundle_revision.c
+++ b/framework/private/src/bundle_revision.c
@@ -23,16 +23,14 @@
  *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
  *  \copyright	Apache License, Version 2.0
  */
-#include <stdlib.h>
-#include <string.h>
+
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/stat.h>
-#include <dirent.h>
-#include <unistd.h>
+#include <archive.h>
+#include <string.h>
 
 #include "bundle_revision_private.h"
-#include "archive.h"
-#include "celix_log.h"
 
 celix_status_t bundleRevision_create(const char *root, const char *location, long revisionNr,
const char *inputFile, bundle_revision_pt *bundle_revision) {
     celix_status_t status = CELIX_SUCCESS;

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/framework/private/src/celix_errorcodes.c
----------------------------------------------------------------------
diff --git a/framework/private/src/celix_errorcodes.c b/framework/private/src/celix_errorcodes.c
index 1fd6fd8..80323e7 100644
--- a/framework/private/src/celix_errorcodes.c
+++ b/framework/private/src/celix_errorcodes.c
@@ -55,8 +55,7 @@ static char* celix_error_string(celix_status_t statcode) {
 
 char* celix_strerror(celix_status_t errorcode, char *buffer, size_t bufferSize) {
     if (errorcode < CELIX_START_ERROR) {
-        strerror_r(errorcode, buffer, bufferSize);
-        return buffer;
+        return strerror(errorcode);
     } else {
     	char * str = celix_error_string(errorcode);
     	strncpy(buffer, str, bufferSize);

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/launcher/private/src/celix_test_runner.cpp
----------------------------------------------------------------------
diff --git a/launcher/private/src/celix_test_runner.cpp b/launcher/private/src/celix_test_runner.cpp
index ae1532f..1855e9f 100644
--- a/launcher/private/src/celix_test_runner.cpp
+++ b/launcher/private/src/celix_test_runner.cpp
@@ -62,12 +62,12 @@ int main(int argc, char *argv[]) {
     return rc;
 }
 
-static void shutdown_framework(int signal) {
+static void shutdown_framework(int __attribute__((unused)) signal) {
     if (framework != NULL) {
         celixLauncher_stop(framework); //NOTE main thread will destroy
     }
 }
 
-static void ignore(int signal) {
+static void ignore(int __attribute__((unused)) signal) {
     //ignoring for signal SIGUSR1, SIGUSR2. Can be used to interrupt sleep, etc
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/de2369c6/utils/private/test/celix_threads_test.cpp
----------------------------------------------------------------------
diff --git a/utils/private/test/celix_threads_test.cpp b/utils/private/test/celix_threads_test.cpp
index 67d9a7a..e5f3014 100644
--- a/utils/private/test/celix_threads_test.cpp
+++ b/utils/private/test/celix_threads_test.cpp
@@ -514,7 +514,7 @@ static int thread_test_func_recur_lock(celix_thread_mutex_t *mu, int i)
{
 	}
 }
 
-static void * thread_test_func_kill(void *arg){
+static void * thread_test_func_kill(void __attribute__((unused)) *arg){
 	int * ret = (int*) malloc(sizeof(*ret));
 	//sleep for a about a minute, or until a kill signal (USR1) is recieved
 	*ret = usleep(60000000);


Mime
View raw message