Project

General

Profile

Actions

Development #1390

closed

Development #1353: Code cleanup for OCT19

Code cleanup: fles/reader/tasks

Added by Volker Friese almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
09/21/2019
Due date:
09/27/2019
% Done:

100%

Estimated time:
2.00 h
Spent time:

Description

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.

Actions #1

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.

Actions #2

Updated by Volker Friese almost 3 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 90

Thanks, I forgot that. There are really only assignments to the variables. Fixed in r15046 (hopefully).

Actions #3

Updated by Volker Friese almost 3 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 90 to 100

Fixed.

Actions

Also available in: Atom PDF