Skip to content

[PWGCF] Fix unused variables, parameters, values - #18641

Open
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:clang-tidy-unused-PWGCF
Open

vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:clang-tidy-unused-PWGCF

Conversation

@vkucera

@vkucera vkucera commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Fixes errors from the following Clang-Tidy categories:

  • clang-analyzer-deadcode.DeadStores
  • clang-diagnostic-unused-parameter
  • clang-diagnostic-unused-variable

Most errors are fixed temporarily by commenting out the unused bits and by adding a FIXME: unused comment.

The final fix is to either remove the unused bits or to fix the bugs which has to be done by someone who knows the intended behaviour.

Fixes errors from the following Clang-Tidy categories:

- `clang-analyzer-deadcode.DeadStores`
- `clang-diagnostic-unused-parameter`
- `clang-diagnostic-unused-variable`

Most errors are fixed temporarily by commenting out the unused bits and by adding a `FIXME: unused` comment.

The final fix is to either remove the unused bits or to fix the bugs which has to be done by someone who knows the intended behaviour.
@github-actions github-actions Bot added the pwgcf label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 363 warnings, 🔕 0 disabled

@github-actions github-actions Bot changed the title Fix unused variables, parameters, values [PWGCF] Fix unused variables, parameters, values Nov 7, 2026
@vkucera
vkucera marked this pull request as ready for review November 7, 2026 18:06
@alibuild

alibuild commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for c226354 at 2026-11-07 19:22:

## sw/BUILD/O2-latest/log
CMake Error at dependencies/FindFairRoot.cmake:68 (set_target_properties):
CMake Error at /sw/slc9_x86-64/CMake/v4.1.4-6/share/cmake-4.1/Modules/FeatureSummary.cmake:499 (message):

Full log here.

@alibuild

alibuild commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for c226354 at 2026-11-07 19:23:

## sw/BUILD/O2-latest/log
CMake Error at dependencies/FindFairRoot.cmake:68 (set_target_properties):
CMake Error at /sw/slc9_x86-64/CMake/v4.1.4-6/share/cmake-4.1/Modules/FeatureSummary.cmake:499 (message):

Full log here.

@alibuild

alibuild commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for c226354 at 2026-11-08 00:31:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'To reproduce the results below locally, run: '\''aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'\''.'
To reproduce the results below locally, run: 'aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'.
++ echo 'To apply all automatic fixes, add the '\''-e O2PHYSICS_CHECKER_FIX=1'\'' option.'
To apply all automatic fixes, add the '-e O2PHYSICS_CHECKER_FIX=1' option.
++ echo 'See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.'
See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.
++ echo 'Found 24 errors and 501 warnings.'
Found 24 errors and 501 warnings.
++ [[ 24 -gt 0 ]]
++ cat /sw/BUILD/c8e377edb1343585fb4811ecbb85c70654c9262c/O2Physics-code-check/errors.txt
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:714:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:715:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:717:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:718:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:720:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:721:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:723:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:724:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:726:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:727:9: error: string concatenation results in allocation of unnecessary temporary strings; consider using 'operator+=' or 'string::append()' instead [performance-inefficient-string-concatenation,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:1702:68: error: redundant explicit casting to the same type 'int64_t' (aka 'long') as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/RobustFluctuationObservables.cxx:1702:104: error: redundant explicit casting to the same type 'int64_t' (aka 'long') as the sub-expression, remove this casting [readability-redundant-casting,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/kaonIsospinFluctuations.cxx:2443:32: error: C-style casts are discouraged; use constructor call syntax [google-readability-casting,-warnings-as-errors]
PWGCF/EbyEFluctuations/Tasks/kaonIsospinFluctuations.cxx:2444:35: error: C-style casts are discouraged; use constructor call syntax [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:139:94: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:141:124: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:157:96: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:159:125: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:516:29: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:523:29: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:532:29: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:536:29: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:687:29: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackNucleus.cxx:691:29: error: C-style casts are discouraged; use static_cast [google-readability-casting,-warnings-as-errors]
++ [[ 501 -gt 0 ]]
++ cat /sw/BUILD/c8e377edb1343585fb4811ecbb85c70654c9262c/O2Physics-code-check/warnings.txt
PWGCF/Core/CorrelationContainer.cxx:54:48: warning: initializer for base class 'TNamed' is redundant [readability-redundant-member-init]
PWGCF/Core/CorrelationContainer.cxx:69:64: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGCF/Core/CorrelationContainer.cxx:96:116: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGCF/Core/CorrelationContainer.cxx:142:1: warning: constructor does not initialize these fields: mEventCount [cppcoreguidelines-pro-type-member-init]
PWGCF/Core/CorrelationContainer.cxx:156:93: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGCF/Core/CorrelationContainer.cxx:265:3: warning: use auto when initializing with new to avoid duplicating the type name [modernize-use-auto]
PWGCF/Core/CorrelationContainer.cxx:274:5: warning: use auto when initializing with a cast to avoid duplicating the type name [modernize-use-auto]
PWGCF/Core/CorrelationContainer.cxx:340:3: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGCF/Core/CorrelationContainer.cxx:341:3: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
PWGCF/Core/CorrelationContainer.cxx:368:3: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
[0 more errors; see full log]

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants