Development #1353: Code cleanup for OCT19
Code cleanup: fles/reader/tasks
The CDash with gcc gives the following warnings in fles/read/tasks:
/home/uhlig/cbm/release/oct19/fles/reader/tasks/CbmTrdRawBeamProfile.cxx: In member function 'void CbmTrdRawBeamProfile::TimeClustering2015CernSPS()': [CTest: warning matched] /home/uhlig/cbm/release/oct19/fles/reader/tasks/CbmTrdRawBeamProfile.cxx:997:9: warning: variable 'lastMSTime' set but not used [-Wunused-but-set-variable] Int_t lastMSTime(0), thisMSTime(0);
/home/uhlig/cbm/release/oct19/fles/reader/tasks/CbmTrdRawBuchData.cxx: In member function 'void CbmTrdRawBuchData::TimeClustering2015CernSPS()': [CTest: warning matched] /home/uhlig/cbm/release/oct19/fles/reader/tasks/CbmTrdRawBuchData.cxx:996:9: warning: variable 'lastMSTime' set but not used [-Wunused-but-set-variable] Int_t lastMSTime(0), thisMSTime(0); ^
/home/uhlig/cbm/release/oct19/fles/reader/tasks/CbmTrdRawPulseMonitor.cxx: In member function 'virtual void CbmTrdRawPulseMonitor::Exec(Option_t*)': [CTest: warning matched] /home/uhlig/cbm/release/oct19/fles/reader/tasks/CbmTrdRawPulseMonitor.cxx:149:32: warning: variable 'combiId' set but not used [-Wunused-but-set-variable] Int_t rowId(0), columnId(0), combiId(0); ^
all of which I do not understand. The metioned variables are used in the code; commenting their declaration leads to compilation errors.
Updated by Florian Uhlig almost 3 years ago
- Status changed from Assigned to In Progress
There is a difference between the warnings "unused variable" and "set but not used variable". In the first case a variable is defined but never used afterwards. In the second case a variable is defined and later on the variable is only used to assign new values to it. The value saved in the variable is never used in any other context except assignment.