velox icon indicating copy to clipboard operation
velox copied to clipboard

Fix warnings caused by -Wunused-but-set-variable

Open kecookier opened this issue 1 year ago • 10 comments

Variable values would not be used if the condition if constexpr (std::is_same_v<T, StringView>) is true.

/__w/incubator-gluten/incubator-gluten/cpp/../ep/build-velox/build/velox_ep/velox/exec/RowContainer.h:1416:3:   required from here
/__w/incubator-gluten/incubator-gluten/cpp/../ep/build-velox/build/velox_ep/velox/exec/RowContainer.h:962:10: warning: variable 'values' set but not used [-Wunused-but-set-variable]
  962 |     auto values = valuesBuffer->asMutableRange<T>();
      |          ^~~~~~
/__w/incubator-gluten/incubator-gluten/cpp/../ep/build-velox/build/velox_ep/velox/exec/RowContainer.h: In instantiation of 'static void facebook::velox::exec::RowContainer::extractValuesWithNulls(const char* const*, folly::Range<const int*>, int32_t, int32_t, int32_t, uint8_t, int32_t, facebook::velox::FlatVector<T>*) [with bool useRowNumbers = true; T = facebook::velox::StringView; int32_t = int; uint8_t = unsigned char]':
/__w/incubator-gluten/incubator-gluten/cpp/../ep/build-velox/build/velox_ep/velox/exec/RowContainer.h:850:47:   required from 'static void facebook::velox::exec::RowContainer::extractColumnTypedInternal(const char* const*, folly::Range<const int*>, int32_t, facebook::velox::exec::RowColumn, int32_t, const VectorPtr&) [with bool useRowNumbers = true; facebook::velox::TypeKind Kind = facebook::velox::TypeKind::VARCHAR; int32_t = int; facebook::velox::VectorPtr = std::shared_ptr<facebook::velox::BaseVector>]'
/__w/incubator-gluten/incubator-gluten/cpp/../ep/build-velox/build/velox_ep/velox/exec/RowContainer.h:817:45:   required from 'static void facebook::velox::exec::RowContainer::extractColumnTyped(const char* const*, folly::Range<const int*>, int32_t, facebook::velox::exec::RowColumn, int32_t, const VectorPtr&) [with facebook::velox::TypeKind Kind = facebook::velox::TypeKind::VARCHAR; int32_t = int; facebook::velox::VectorPtr = std::shared_ptr<facebook::velox::BaseVector>]'
/__w/incubator-gluten/incubator-gluten/cpp/../ep/build-velox/build/velox_ep/velox/exec/RowContainer.h:1416:3:   required from here
/__w/incubator-gluten/incubator-gluten/cpp/../ep/build-velox/build/velox_ep/velox/exec/RowContainer.h:928:10: warning: variable 'values' set but not used [-Wunused-but-set-variable]
  928 |     auto values = valuesBuffer->asMutableRange<T>();
      |          ^~~~~~

kecookier avatar May 17 '24 12:05 kecookier

Deploy Preview for meta-velox canceled.

Name Link
Latest commit 3661aa7c32f9fbee1025b2158896dad6fceeec35
Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/667ea5d2906a530008a33264

netlify[bot] avatar May 17 '24 12:05 netlify[bot]

@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar May 18 '24 21:05 facebook-github-bot

The CI build failed because the FOLLY_MAYBE_UNUSED macro could not be found in the specified version of Folly (https://github.com/facebook/folly/archive/refs/tags/v2024.04.01.00.tar.gz). Let's replace it with the [[maybe_unused]] attribute instead.

In file included from /__w/velox/velox/velox/./velox/exec/Spiller.h:21,
                 from /__w/velox/velox/velox/./velox/exec/Driver.h:31,
                 from /__w/velox/velox/velox/./velox/exec/Operator.h:21,
                 from /__w/velox/velox/velox/./velox/exec/tests/utils/QueryAssertions.h:21,
                 from /__w/velox/velox/velox/./velox/exec/tests/utils/AssertQueryBuilder.h:18,
                 from /__w/velox/velox/velox/velox/expression/tests/ExpressionRunner.cpp:22:
/__w/velox/velox/velox/./velox/exec/RowContainer.h: In static member function 'static void facebook::velox::exec::RowContainer::extractValuesWithNulls(const char* const*, folly::Range<const int*>, int32_t, int32_t, int32_t, uint8_t, int32_t, facebook::velox::FlatVector<T>*)':
/__w/velox/velox/velox/./velox/exec/RowContainer.h:928:5: error: 'FOLLY_MAYBE_UNUSED' was not declared in this scope; did you mean 'FMT_MAYBE_UNUSED'?
  928 |     FOLLY_MAYBE_UNUSED auto values = valuesBuffer->asMutableRange<T>();
      |     ^~~~~~~~~~~~~~~~~~
      |     FMT_MAYBE_UNUSED
/__w/velox/velox/velox/./velox/exec/RowContainer.h:945:11: error: 'values' was not declared in this scope; did you mean 'valueAt'?
  945 |           values[resultIndex] = valueAt<T>(row, offset);
      |           ^~~~~~
      |           valueAt

kecookier avatar May 20 '24 09:05 kecookier

HI @kecookier Please give me couple more days to land this ; have to fix a few failing builds related to this internally.

kgpai avatar May 28 '24 21:05 kgpai

HI @kecookier Please give me couple more days to land this ; have to fix a few failing builds related to this internally.

Thanks!

kecookier avatar May 29 '24 02:05 kecookier

@kecookier can you please resolve the CI failures

bikramSingh91 avatar Jun 27 '24 18:06 bikramSingh91

@kecookier can you please resolve the CI failures

I will work on fixing it as soon as possible. Thank you for your patience.

kecookier avatar Jun 28 '24 02:06 kecookier

@kecookier You need to rebase your branch with main to fix the CI failure.

majetideepak avatar Jun 28 '24 06:06 majetideepak

@majetideepak I have rebased the main branch. Could you please help trigger the CI?

kecookier avatar Jun 28 '24 12:06 kecookier

@bikramSingh91 Just a friendly ping, the CI has been fixed. Could you please help merge it?

kecookier avatar Jul 01 '24 09:07 kecookier

@xiaoxmeng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Aug 12 '24 16:08 facebook-github-bot

@xiaoxmeng merged this pull request in facebookincubator/velox@5aaae7d08f96c164beffdc8e4e495d37c5d7caa5.

facebook-github-bot avatar Aug 12 '24 21:08 facebook-github-bot

Conbench analyzed the 1 benchmark run on commit 5aaae7d0.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

conbench-facebook[bot] avatar Aug 12 '24 21:08 conbench-facebook[bot]