ATLASG-2752: Suppress waring from HDF5Utils
We're getting a warning from cppcheck within a multi-parameter template. It only happens when the first argument is 0
, since in that case other conditions are trivial, apparently too trivial for cppcheck.
Merge request reports
Activity
This merge request affects 1 package:
- PhysicsAnalysis/AnalysisCommon/HDF5Utils
This merge request affects 1 file:
- PhysicsAnalysis/AnalysisCommon/HDF5Utils/HDF5Utils/Writer.h
Could not map the following files to a domain:
- PhysicsAnalysis/AnalysisCommon/HDF5Utils/HDF5Utils/Writer.h
Adding @dguest as watcher
added 24.0 analysis-review-required no-domain review-pending-level-1 labels
CI Result SUCCESS (hash 5499b0aa)Athena AnalysisBase AthAnalysis externals cmake make tests Full details available on this CI monitor view. Check the JIRA CI status board for known problems
Athena: number of compilation errors 0, warnings 0
AnalysisBase: number of compilation errors 0, warnings 0
AthAnalysis: number of compilation errors 0, warnings 0
For experts only: Jenkins output [CI-MERGE-REQUEST-EL9 13225] (remote access info)added analysis-review-approved label and removed analysis-review-required label
added review-approved label and removed review-pending-level-1 label
added review-approved-point1 label
added review-approved-tier0 label
mentioned in commit b79b4aa2
mentioned in merge request !73161 (merged)
Hi
It will be always nicer for posterity to include what you fix
/build/atnight/localbuilds/nightlies/Athena/main--cppcheck/athena/PhysicsAnalysis/AnalysisCommon/HDF5Utils/HDF5Utils/Writer.h:197:36: note: 'any_type' is assigned value 'ok_type' here. static const bool any_type = ok_type; ^ /build/atnight/localbuilds/nightlies/Athena/main--cppcheck/athena/PhysicsAnalysis/AnalysisCommon/HDF5Utils/HDF5Utils/Writer.h:456:29: note: Logical conjunction always evaluates to false: internal::CheckType<N,T,I>::any_type && !(internal::CheckType<N,T,I>::ok_type). !(checkType::any_type && !checkType::ok_type),
Now actually if we set
any_type = ok_type
for case of 0 (I guess this comes from when the specific struct is called), it is true that(checkType::any_type && !checkType::ok_type)
would become(checkType::ok_type && !checkType::ok_type)
So basically we check that something is both true and not true at the same time .
Above the only thing you check is
>=0
no, what other trivial conditions you refer here?Technically what the warning says can happen as kind of says. In super short I find the description a bit cryptic and the comment not helping much either ...
Edited by Christos Anastopoulos