Skip to content

[Common] Fix unused variables, parameters, values - #18638

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

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

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 common label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

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

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

alibuild commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for d4d4845 at 2026-11-07 19:09:

## 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 d4d4845 at 2026-11-08 00:03:

## 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 2 errors and 169 warnings.'
Found 2 errors and 169 warnings.
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/42b02fe604eefd0535ec72f01d45a8a2de38f012/O2Physics-code-check/errors.txt
Common/Tools/Multiplicity/macros/runGlauberFit.C:41:14: error: variable length arrays in C++ are a Clang extension [clang-diagnostic-vla-cxx-extension,-warnings-as-errors]
Common/Tools/Multiplicity/macros/runGlauberFit.C:41:21: error: variable length arrays in C++ are a Clang extension [clang-diagnostic-vla-cxx-extension,-warnings-as-errors]
++ [[ 169 -gt 0 ]]
++ cat /sw/BUILD/42b02fe604eefd0535ec72f01d45a8a2de38f012/O2Physics-code-check/warnings.txt
Common/Core/macros/testCollisionTypeHelper.C:26:3: warning: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto]
Common/TableProducer/PID/pidTOFBase.cxx:56:7: warning: variable 'trackDistanceForGoodMatch' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
Common/TableProducer/PID/pidTOFBase.cxx:57:7: warning: variable 'trackDistanceForGoodMatchLowMult' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
Common/TableProducer/PID/pidTOFBase.cxx:58:5: warning: variable 'multiplicityThreshold' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
Common/TableProducer/PID/pidTOFBase.cxx:64:12: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFBase.cxx:165:7: warning: variable 'trackSampleMinMomentum' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
Common/TableProducer/PID/pidTOFBase.cxx:166:7: warning: variable 'trackSampleMaxMomentum' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
Common/TableProducer/PID/pidTOFBase.cxx:187:8: warning: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init]
Common/TableProducer/PID/pidTOFBase.cxx:236:26: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFBase.cxx:240:27: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFBase.cxx:244:25: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFBase.cxx:248:29: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFBase.cxx:268:32: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFBase.cxx:281:9: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]
Common/TableProducer/PID/pidTOFBase.cxx:290:11: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Common/TableProducer/PID/pidTOFBase.cxx:310:7: warning: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto]
Common/TableProducer/PID/pidTOFBase.cxx:375:84: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFBase.cxx:437:84: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFBase.cxx:457:7: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/TableProducer/PID/pidTOFBase.cxx:458:7: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/TableProducer/PID/pidTOFMerge.cxx:79:12: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFMerge.cxx:85:8: warning: constructor does not initialize these fields: ccdb, tofResponse [cppcoreguidelines-pro-type-member-init]
Common/TableProducer/PID/pidTOFMerge.cxx:139:33: warning: redundant boolean literal in conditional assignment [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFMerge.cxx:213:7: warning: variable 'trackSampleMinMomentum' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
Common/TableProducer/PID/pidTOFMerge.cxx:214:7: warning: variable 'trackSampleMaxMomentum' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
Common/TableProducer/PID/pidTOFMerge.cxx:241:8: warning: constructor does not initialize these fields: ccdb, tofResponse [cppcoreguidelines-pro-type-member-init]
Common/TableProducer/PID/pidTOFMerge.cxx:313:26: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFMerge.cxx:317:26: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFMerge.cxx:325:32: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFMerge.cxx:404:86: warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
Common/TableProducer/PID/pidTOFMerge.cxx:423:9: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/TableProducer/PID/pidTOFMerge.cxx:424:9: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
[0 more errors; see full log]

Full log here.

@alibuild

alibuild commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for d4d4845 at 2026-11-07 19:12:

## 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.

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.

2 participants