compiler warning fixes in unpackers & hitfinders
compiler warning fixes in unpackers & hitfinders.
@d.smith, I made you a reviewer because your name is in the author list.
@d.smith ,
In addition, there also a warning in the rich unpacker: subSubEventSize and subSubEventId may be uninitialized:
/home/cbmdock/cbmroot/algo/detectors/rich/Unpack.cxx: In member function 'void cbm::algo::rich::Unpack::ProcessHubBlock(cbm::algo::rich::MicrosliceReader&, cbm::algo::rich::Unpack::MSContext&) const':
/home/cbmdock/cbmroot/algo/detectors/rich/Unpack.cxx:113:39: warning: 'subSubEventSize' may be used uninitialized in this function [-Wmaybe-uninitialized]
subSubEventSize = ProcessCtsHeader(reader, subSubEventSize, subSubEventId);
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/cbmdock/cbmroot/algo/detectors/rich/Unpack.cxx:113:39: warning: 'subSubEventId' may be used uninitiali
I assume one should replace these lines:
//last event ist expected to be CTS
if (totalSize != hubSize || !isLast) { ctx.monitor.fNumErrInvalidHubSize++; }
subSubEventSize = ProcessCtsHeader(reader, subSubEventSize, subSubEventId);
ProcessSubSubEvent(reader, subSubEventSize, subSubEventId, ctx);
with:
//last event ist expected to be CTS
if (totalSize != hubSize || !isLast) { ctx.monitor.fNumErrInvalidHubSize++; }
else{
subSubEventSize = ProcessCtsHeader(reader, subSubEventSize, subSubEventId);
ProcessSubSubEvent(reader, subSubEventSize, subSubEventId, ctx);
}
or even:
//last event ist expected to be CTS
if (totalSize != hubSize || !isLast) { ctx.monitor.fNumErrInvalidHubSize++; }
else{ return;}
But I don't trust myself to touch the unpacked code. Please have a look.
Merge request reports
Activity
requested review from @d.smith
assigned to @se.gorbunov
added 2 commits
- Resolved by Pierre-Alain Loizeau
- Resolved by Sergey Gorbunov
added 2 commits
Dear @f.uhlig, @v.friese, @p.-a.loizeau, @s.lebedev,
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
@se.gorbunov Some of the variables are indeed unused, as they were used for monitoring in the original code, but full monitoring is not implemented here. The
reader.NextWord()
are necessary, as they change the state ofreader
by moving it one word forward. The return value is indeed not always used, as some words are padding. If we remove the variable assignments, then perhaps there will be a compiler warning that the return value is ignored.I will comment on the proposed changes individually.
- Resolved by Dominik Smith
- Resolved by Dominik Smith
- Resolved by Dominik Smith
- Resolved by Dominik Smith
- Resolved by Dominik Smith
- Resolved by Dominik Smith