Bug Summary

File:programs/Simulation/HDGeant/hdgeant.cc
Location:line 34, column 3
Description:Value stored to 'retcode' is never read

Annotated Source Code

1
2#include <stdlib.h>
3
4#include <iostream>
5#include <string>
6using namespace std;
7
8
9// These are defined in copytoplusplus.cc
10extern string INFILE;
11extern string OUTFILE;
12extern bool POSTSMEAR;
13extern string MCSMEAROPTS;
14extern bool DELETEUNSMEARED;
15
16// Declare routines callable from FORTRAN
17extern "C" int hdgeant_(void); // define in hdgeant_f.F
18
19
20int main(int narg, char *argv[])
21{
22 // Run hdgeant proper
23 int res = hdgeant_();
24
25 // Optionally smear the resulting output file
26 if(POSTSMEAR){
27 string cmd = "mcsmear "+MCSMEAROPTS+" "+OUTFILE;
28 cout<<endl;
29 cout<<"Smearing data with:"<<endl;
30 cout<<endl;
31 cout<<cmd<<endl;
32 cout<<endl;
33 int retcode;
34 retcode = system(cmd.c_str());
Value stored to 'retcode' is never read
35
36 if(DELETEUNSMEARED){
37 cmd = "rm -f "+OUTFILE;
38 cout<<endl;
39 cout<<"Deleting unsmeared file:"<<endl;
40 cout<<" "<<cmd<<endl;
41 retcode = system(cmd.c_str());
42 }
43 }else{
44 if(DELETEUNSMEARED){
45 cerr<<endl;
46 cerr<<"The DELETEUNSMEARED flag is set indicating that you want the output file"<<endl;
47 cerr<<"\""<<OUTFILE<<"\" to be deleted. However, the POSTSMEAR flag is not set"<<endl;
48 cerr<<"so no smeared data file was created so deleting the unsmeared file is"<<endl;
49 cerr<<"most likely NOT what you want to do. Therefore, I'm ignoring the"<<endl;
50 cerr<<"DELETEUNSMEARED flag. "<<__FILE__"hdgeant.cc"<<":"<<__LINE__50<<endl;
51 }
52 }
53
54 return res;
55}
56