-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[LLVM 9] Fixed build errors #28810
Conversation
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) |
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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]
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28810/13513
|
A new Pull Request was created by @smuzaffar (Malik Shahzad Muzaffar) for master. It involves the following packages: Alignment/MillePedeAlignmentAlgorithm @perrotta, @Martin-Grunewald, @slava77, @christopheralanwest, @tocheng, @cmsbuild, @franzoni, @tlampen, @fwyzard, @pohsun, @santocch can you please review it and eventually sign? Thanks. 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; |
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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) ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
The tests are being triggered in jenkins.
|
-1 Tested at: dcdf62c CMSSW: CMSSW_11_1_CLANG_X_2020-01-27-2300 I found follow errors while testing this PR Failed tests: HeaderConsistency |
Comparison job queued. |
+1 |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1 |
+1
|
+1 |
merge |
+1 |
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. |
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