You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2017/12/09 01:02:48 UTC

[incubator-mxnet] branch master updated: [clang][warning] fix warnings about braced initializer (fixes warning in concurrenc… (#8870)

This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c22bc7  [clang][warning] fix warnings about braced initializer (fixes warning in concurrenc… (#8870)
1c22bc7 is described below

commit 1c22bc71052f54eb21a6079eebdc7383dafbb4ee
Author: Pedro Larroy <92...@users.noreply.github.com>
AuthorDate: Sat Dec 9 02:02:45 2017 +0100

    [clang][warning] fix warnings about braced initializer (fixes warning in concurrenc… (#8870)
    
    * Fix warning on optimizer.h, MXNETCPP_REGISTER_OPTIMIZER return value not used
    
    * remove unused variable cached_op
    
    * [CMake] fix warnings about braced initializer
---
 CMakeLists.txt                            | 3 +++
 cpp-package/include/mxnet-cpp/optimizer.h | 6 ++----
 src/c_api/c_api_ndarray.cc                | 1 -
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4febbe4..4804793 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,6 +87,9 @@ else(MSVC)
   check_cxx_compiler_flag("-std=c++0x"   SUPPORT_CXX0X)
   check_cxx_compiler_flag("-msse2"       SUPPORT_MSSE2)
   set(CMAKE_C_FLAGS "-Wall -Wno-unknown-pragmas -fPIC -Wno-sign-compare")
+  if ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang$")
+    set(CMAKE_C_FLAGS "-Wno-braced-scalar-init")
+  endif()
   if(CMAKE_BUILD_TYPE STREQUAL "Debug")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
   elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
diff --git a/cpp-package/include/mxnet-cpp/optimizer.h b/cpp-package/include/mxnet-cpp/optimizer.h
index 4aebb55..f3763bb 100644
--- a/cpp-package/include/mxnet-cpp/optimizer.h
+++ b/cpp-package/include/mxnet-cpp/optimizer.h
@@ -130,10 +130,8 @@ class OptimizerRegistry {
   OptimizerRegistry() = delete;
   ~OptimizerRegistry() = delete;
 };
-
-#define MXNETCPP_REGISTER_OPTIMIZER(Name, OptimizerType)          \
-  static int __make_ ## OptimizerType ## _ ## Name ## __ = \
-       OptimizerRegistry::__REGISTER__(#Name, [](){return new OptimizerType();})
+#define MXNETCPP_REGISTER_OPTIMIZER(Name, OptimizerType)\
+  OptimizerRegistry::__REGISTER__(#Name, [](){return new OptimizerType();})
 
 class SGDOptimizer : public Optimizer {
  public:
diff --git a/src/c_api/c_api_ndarray.cc b/src/c_api/c_api_ndarray.cc
index 51f30e2..d67d52c 100644
--- a/src/c_api/c_api_ndarray.cc
+++ b/src/c_api/c_api_ndarray.cc
@@ -191,7 +191,6 @@ int MXInvokeCachedOp(CachedOpHandle handle,
                      NDArrayHandle *inputs,
                      int *num_outputs,
                      NDArrayHandle **outputs) {
-  static const auto cached_op = nnvm::Op::Get("_CachedOp");
   MXAPIThreadLocalEntry *ret = MXAPIThreadLocalStore::Get();
 
   API_BEGIN();

-- 
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].