Skip to content

Commit e06f9ae

Browse files
committed
[LLVM Analyzer][Generators] Cleanup LLVM analyzer warnings
1 parent 4a85623 commit e06f9ae

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

GeneratorInterface/EvtGenInterface/plugins/DataCardFileWriter.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ using namespace gen;
1111

1212
DataCardFileWriter::DataCardFileWriter(const edm::ParameterSet& pset) {
1313
std::string FileName = pset.getParameter<std::string>("FileName");
14-
std::string Base = std::getenv("CMSSW_BASE");
14+
char* tmp = std::getenv("CMSSW_BASE");
15+
assert(tmp);
16+
std::string Base(tmp);
1517
Base += "/src/";
1618
std::cout << "Writting file:" << Base + FileName << std::endl;
1719
std::ofstream outputFile(Base + FileName);

GeneratorInterface/EvtGenInterface/plugins/EvtGen/EvtGenInterface.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,16 @@ void EvtGenInterface::init() {
301301
//Setup evtGen following instructions on http://evtgen.warwick.ac.uk/docs/external/
302302
bool convertPythiaCodes = fPSet->getUntrackedParameter<bool>(
303303
"convertPythiaCodes", true); // Specify if we want to use Pythia 6 physics codes for decays
304-
std::string pythiaDir =
304+
char* tmp =
305305
std::getenv("PYTHIA8DATA"); // Specify the pythia xml data directory to use the default PYTHIA8DATA location
306-
if (pythiaDir.empty()) {
306+
307+
if (tmp == nullptr) {
307308
edm::LogError("EvtGenInterface::~EvtGenInterface")
308309
<< "EvtGenInterface::init() PYTHIA8DATA not defined. Terminating program ";
309310
exit(0);
310311
}
312+
313+
std::string pythiaDir(tmp);
311314
std::string photonType("gamma"); // Specify the photon type for Photos
312315
bool useEvtGenRandom(true); // Specify if we want to use the EvtGen random number engine for these generators
313316

GeneratorInterface/RivetInterface/plugins/RivetAnalyzer.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ void RivetAnalyzer::beginJob() {
5454
//set the environment, very ugly but rivet is monolithic when it comes to paths
5555
char* cmsswbase = std::getenv("CMSSW_BASE");
5656
char* cmsswrelease = std::getenv("CMSSW_RELEASE_BASE");
57+
// These should never fail
58+
assert(cmsswbase);
59+
assert(cmsswrelease);
5760
if (!std::getenv("RIVET_REF_PATH")) {
5861
const std::string rivetref = string(cmsswbase) +
5962
"/src/GeneratorInterface/RivetInterface/data:" + string(cmsswrelease) +

0 commit comments

Comments
 (0)