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

[LLVM 9] Fixed build errors #28810

Merged
merged 1 commit into from
Jan 30, 2020
Merged

[LLVM 9] Fixed build errors #28810

merged 1 commit into from
Jan 30, 2020

Conversation

smuzaffar
Copy link
Contributor

PR description:

Build with LLVM 9.0 fails due to these errors. This PR proposes the changes to make llvm 9 happy

PR validation:

locally build with llvm 9.0.1 do not fail any more

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@@ -169,7 +169,7 @@ class MillePedeFileReader {

const std::array<std::string, 8> coord_str = {{"X", "Y", "Z", "theta_X", "theta_Y", "theta_Z", "extra_DOF", "none"}};
inline std::ostream& operator<<(std::ostream& os, const AlignPCLThresholds::coordType& c) {
if (c >= AlignPCLThresholds::endOfTypes || c < 0)
if (c >= AlignPCLThresholds::endOfTypes || c < AlignPCLThresholds::X)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can drop || c<0 part as it is always false

Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:172:48: error: result of comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-enum-zero-compare]

Copy link
Contributor

@makortel makortel Jan 29, 2020

Choose a reason for hiding this comment

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

In principle the whole if statement seems to be redundant (unless something casts an integer into the enumeration without bounds checking)

enum coordType { X, Y, Z, theta_X, theta_Y, theta_Z, extra_DOF, endOfTypes };

@@ -192,7 +192,7 @@ class EnergyScaleCorrection_class {
void ReadSmearingFromFile(TString filename); ///< File structure: category constTerm alpha;
public:
inline void SetSmearingType(fileFormat_t value) {
if (value >= 0 && value <= 1) {
if (value <= 1) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

value >= 0 is always true as value is of type fileFormat_t enum.

EgammaAnalysis/ElectronTools/interface/EnergyScaleCorrection_class.h:195:15: error: result of comparison of unsigned enum expression >= 0 is always true [-Werror,-Wtautological-unsigned-enum-zero-compare]

@@ -162,7 +162,7 @@ bool HLTJetSortedVBFFilter<T>::hltFilter(edm::Event& event,
nJet++;
// cout << "jetPt=" << jet->pt() << "\tjetEta=" << jet->eta() << "\tjetCSV=" << value << endl;
}
if (b1_idx >= sorted.size() || b1_idx < 0)
if (b1_idx >= sorted.size())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

b1_idx is unsigned int so b1_idx < 0 is always false

HLTrigger/JetMET/src/HLTJetSortedVBFFilter.cc:165:43: error: result of comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-unsigned-zero-compare]

@@ -171,7 +171,7 @@ void EnergyScaleCorrection::addSmearing(const std::string& category,
}

void EnergyScaleCorrection::setSmearingType(FileFormat value) {
if (value >= 0 && value <= 1) {
if (value <= 1) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

value >= 0 is always true as value is of type FileFormat enum.

RecoEgamma/EgammaTools/src/EnergyScaleCorrection.cc:174:13: error: result of comparison of unsigned enum expression >= 0 is always true [-Werror,-Wtautological-unsigned-enum-zero-compare]

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28810/13513

  • This PR adds an extra 32KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @smuzaffar (Malik Shahzad Muzaffar) for master.

It involves the following packages:

Alignment/MillePedeAlignmentAlgorithm
EgammaAnalysis/ElectronTools
HLTrigger/JetMET
RecoEgamma/EgammaTools
RecoTauTag/RecoTau

@perrotta, @Martin-Grunewald, @slava77, @christopheralanwest, @tocheng, @cmsbuild, @franzoni, @tlampen, @fwyzard, @pohsun, @santocch can you please review it and eventually sign? Thanks.
@Sam-Harper, @adewit, @riga, @tlampen, @varuns23, @tocheng, @lgray, @Martin-Grunewald, @sobhatta, @afiqaize, @mschrode, @mmusich, @jainshilpi this is something you requested to watch as well.
@davidlange6, @silviodonato, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@@ -168,8 +168,6 @@ class DPFIsolation : public deep_tau::DeepTauBase {

if (p.pt() < 0.5)
continue;
if (p.fromPV() < 0)
continue;
Copy link
Contributor Author

@smuzaffar smuzaffar Jan 28, 2020

Choose a reason for hiding this comment

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

p.fromPV() returns PVAssoc enum which is always >=0 ( https://cmssdt.cern.ch/lxr/source/DataFormats/PatCandidates/interface/PackedCandidate.h#0703 )

RecoTauTag/RecoTau/plugins/DPFIsolation.cc:171:24: error: result of comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-enum-zero-compare]

Copy link
Contributor

Choose a reason for hiding this comment

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

unless the check was supposed to be p.fromPV() == 0 (and p.fromPV() <= 1 below) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ocolegrove @MRD2F @mbluj
It appears that a check "p.fromPV() < 0" is redundant.
please double-check that we are not hiding some problem in your original code.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it is fine the remove the p.fromPV() < 0 redundant check.

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 28, 2020

The tests are being triggered in jenkins.
Tested with other pull request(s) cms-sw/cmsdist#5505
Test Parameters:

@cmsbuild
Copy link
Contributor

-1

Tested at: dcdf62c

CMSSW: CMSSW_11_1_CLANG_X_2020-01-27-2300
SCRAM_ARCH: slc7_amd64_gcc820
You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f5cb1c/4385/summary.html

I found follow errors while testing this PR

Failed tests: HeaderConsistency

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

+1
Tested at: dcdf62c
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fa6cfb/4397/summary.html
CMSSW: CMSSW_11_1_X_2020-01-28-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-fa6cfb/4397/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2697090
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2696743
  • DQMHistoTests: Total skipped: 346
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@Martin-Grunewald
Copy link
Contributor

+1

@slava77
Copy link
Contributor

slava77 commented Jan 30, 2020

+1

for #28810 dcdf62c

@christopheralanwest
Copy link
Contributor

+1

@silviodonato
Copy link
Contributor

merge
@santocch please have a look

@cmsbuild cmsbuild merged commit dc86c99 into cms-sw:master Jan 30, 2020
@santocch
Copy link

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will be automatically merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants