You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2021/06/07 16:04:44 UTC

[arrow] branch master updated: ARROW-12982: [C++] Re-enable unused-variable warning

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

apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new b788b0d  ARROW-12982: [C++] Re-enable unused-variable warning
b788b0d is described below

commit b788b0da5cef805cd9518e9873efe5f3e19a4b81
Author: Weston Pace <we...@gmail.com>
AuthorDate: Mon Jun 7 18:03:01 2021 +0200

    ARROW-12982: [C++] Re-enable unused-variable warning
    
    The warning was originally disabled out of convenience in https://github.com/apache/arrow/pull/3976
    
    Closes #10458 from westonpace/experiment/no-unused-variable
    
    Authored-by: Weston Pace <we...@gmail.com>
    Signed-off-by: Antoine Pitrou <an...@python.org>
---
 cpp/cmake_modules/SetupCxxFlags.cmake    | 3 ---
 cpp/src/arrow/compute/exec/expression.cc | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake b/cpp/cmake_modules/SetupCxxFlags.cmake
index e1b3c1b..0a92702 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -266,16 +266,13 @@ if("${BUILD_WARNING_LEVEL}" STREQUAL "CHECKIN")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-conversion")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-deprecated-declarations")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-sign-conversion")
-    set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unused-variable")
   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
     if(WIN32)
       set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /Wall")
       set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /Wno-deprecated")
-      set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /Wno-unused-variable")
     else()
       set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
       set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-deprecated")
-      set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unused-variable")
     endif()
   else()
     message(FATAL_ERROR "${UNKNOWN_COMPILER_MESSAGE}")
diff --git a/cpp/src/arrow/compute/exec/expression.cc b/cpp/src/arrow/compute/exec/expression.cc
index 91bf731..1c8c82d 100644
--- a/cpp/src/arrow/compute/exec/expression.cc
+++ b/cpp/src/arrow/compute/exec/expression.cc
@@ -616,7 +616,7 @@ std::vector<FieldRef> FieldsInExpression(const Expression& expr) {
 bool ExpressionHasFieldRefs(const Expression& expr) {
   if (expr.literal()) return false;
 
-  if (auto ref = expr.field_ref()) return true;
+  if (expr.field_ref()) return true;
 
   for (const Expression& arg : CallNotNull(expr)->arguments) {
     if (ExpressionHasFieldRefs(arg)) return true;