warning fix in the bmon unpacker
This MR fixes the following compiler warning:
/home/cbmdock/cbmroot/algo/detectors/bmon/Unpack.cxx: In member function 'cbm::algo::bmon::Unpack::resultType cbm::algo::bmon::Unpack::operator()(const uint8_t*, const fles::MicrosliceDescriptor&, uint64_t) const':
/home/cbmdock/cbmroot/algo/detectors/bmon/Unpack.cxx:130:50: warning: '*((void*)& time +8)' may be used uninitialized in this function [-Wmaybe-uninitialized]
double messageTime = message.getMsgFullTimeD(time.currentEpochInTs) - elinkPar.fTimeOffset;
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/home/cbmdock/cbmroot/algo/detectors/bmon/Unpack.cxx:27:14: note: '*((void*)& time +8)' was declared here
TimeSpec time;
^~~~
The compiler complains that time.currentEpochInTs field may be used uninitialized. In fact, the code logic is correct because there is a check that ensures the first message is an epoch message. But it is too complicated for the compiler. I rewrote the code to read the first message explicitly as an epoch message. It makes the compiler happy.
Merge request reports
Activity
requested review from @d.smith
assigned to @d.smith
Dear @f.uhlig, @v.friese, @p.-a.loizeau,
you have been identified as code owner of at least one file which was changed with this merge request.
Please check the changes and approve them or request changes.
added CodeOwners label
added BugFix label
added 51 commits
-
2bd4776b...68f68cfe - 50 commits from branch
computing:master
- 8419a3fe - warning fix in the bmon unpacker
-
2bd4776b...68f68cfe - 50 commits from branch
enabled an automatic merge when the pipeline for 8419a3fe succeeds
added WarnFix label