From 9ef0e304f52b4c509cb76fe910f2935ede85d0ca Mon Sep 17 00:00:00 2001 From: Stefan Wunsch <stefan.wunsch@cern.ch> Date: Wed, 10 Jul 2019 17:05:42 +0200 Subject: [PATCH] [RDF] Avoid unused variable warning * Show up with gcc9 --- tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx | 2 ++ tree/dataframe/inc/ROOT/RDF/RAction.hxx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx b/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx index bb4fc3c721b..9ce822db506 100644 --- a/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx +++ b/tree/dataframe/inc/ROOT/RDF/ActionHelpers.hxx @@ -1349,6 +1349,7 @@ public: // With this code, we set the value of the pointer in the output branch anew when needed. // Nota bene: the extra ",0" after the invocation of SetAddress, is because that method returns void and // we need an int for the expander list. + (void)slot; // avoid bogus 'unused parameter' warning int expander[] = {(fBranches[slot][S] && fBranchAddresses[slot][S] != GetData(values) ? fBranches[slot][S]->SetAddress(GetData(values)), fBranchAddresses[slot][S] = GetData(values), 0 : 0, 0)..., @@ -1372,6 +1373,7 @@ public: template <std::size_t... S> void UpdateBoolArrays(unsigned int slot, BranchTypes &... values, std::index_sequence<S...> /*dummy*/) { + (void)slot; // avoid bogus 'unused parameter' warning int expander[] = { (UpdateBoolArray(fBoolArrays[slot], values, fOutputBranchNames[S], *fOutputTrees[slot]), 0)..., 0}; (void)expander; // avoid unused variable warnings for older compilers such as gcc 4.9 diff --git a/tree/dataframe/inc/ROOT/RDF/RAction.hxx b/tree/dataframe/inc/ROOT/RDF/RAction.hxx index 972bc66f614..4444e080f5c 100644 --- a/tree/dataframe/inc/ROOT/RDF/RAction.hxx +++ b/tree/dataframe/inc/ROOT/RDF/RAction.hxx @@ -73,6 +73,8 @@ void InitRDFValues(unsigned int slot, std::vector<RTypeErasedColumnValue> &value ROOT::TypeTraits::TypeList<ColTypes...>, const std::array<bool, sizeof...(S)> &isTmpColumn) { using expander = int[]; + (void)slot; // avoid bogus 'unused parameter' warning + (void)r; // avoid bogus 'unused parameter' warning (void)expander{(values.emplace_back(std::make_unique<RColumnValue<ColTypes>>()), 0)..., 0}; (void)expander{(isTmpColumn[S] ? values[S].Cast<ColTypes>()->SetTmpColumn(slot, customCols.GetColumns().at(bn.at(S)).get()) -- GitLab