Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLVM10] EventFilter fix warnings for clang 10 #29592

Merged
merged 2 commits into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions EventFilter/CSCRawToDigi/plugins/CSCDigiValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ bool CSCDigiValidator::filter(edm::Event& iEvent, const edm::EventSetup& iSetup)
CSCALCTDigiCollection::DigiRangeIterator alct = _alct->begin(), salct = _salct->begin();
CSCCorrelatedLCTDigiCollection::DigiRangeIterator lct = _lct->begin(), slct = _slct->begin();
L1CSCTrackCollection::const_iterator trk = _trk->begin(), strk = _strk->begin();
std::vector<csctf::TrackStub>::const_iterator dt = _dt->get().begin(), sdt = _sdt->get().begin();
// WARNING 5_0_X
dt++;
dt--;
sdt++;
sdt--;

//per detID, create lists of various digi types
matchingDetWireCollection wires;
Expand Down
2 changes: 1 addition & 1 deletion EventFilter/RPCRawToDigi/plugins/RPCTwinMuxDigiToRaw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void RPCTwinMuxDigiToRaw::produce(edm::Event& event, edm::EventSetup const& setu

std::map<int, FEDRawData> fed_data;
// Loop over the FEDs
for (std::pair<int, std::vector<RPCAMCLink> > const& fed_amcs : fed_amcs_) {
for (std::pair<int, std::vector<RPCAMCLink> > const fed_amcs : fed_amcs_) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is strange.
why is a simple const OK here? Isn't this going to trigger a copy of a vector?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this fixes are suggested by the compiler. It says you need copy here or your need a reference here, in this case it said remove the reference
https://cmssdt.cern.ch/SDT/cgi-bin/buildlogs/slc7_amd64_gcc820/CMSSW_11_1_CLANG_X_2020-04-27-2300/EventFilter/RPCRawToDigi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrodozov , the correct fux is to use std::pair<const int

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FEDRawData& data = data_collection->FEDData(fed_amcs.first);
unsigned int size(0);

Expand Down
2 changes: 1 addition & 1 deletion EventFilter/Utilities/src/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ namespace Json {
while (token.type_ == tokenComment && ok) {
ok = readToken(token);
}
bool badTokenType = (token.type_ == tokenArraySeparator && token.type_ == tokenArrayEnd);
bool badTokenType = (token.type_ == tokenArraySeparator || token.type_ == tokenArrayEnd);
if (!ok || badTokenType) {
return addErrorAndRecover("Missing ',' or ']' in array declaration", token, tokenArrayEnd);
}
Expand Down