Project

General

Profile

Actions

Development #1368

closed

Development #1353: Code cleanup for OCT19

Code cleanup: beamtime/tof/display/CbmTofOnlineDisplay.cxx

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

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

100%

Estimated time:
0.50 h

Description

Compiler warning:

beamtime/tof/display/CbmTofOnlineDisplay.cxx: In member function 'virtual InitStatus CbmTofOnlineDisplay::Init()':
[CTest: warning matched] /home/uhlig/cbm/release/oct19/beamtime/tof/display/CbmTofOnlineDisplay.cxx:573:17: warning: unused variable 'tProfile' [-Wunused-variable]
       TProfile* tProfile = h2->ProfileX();
                 ^

Probably meant in line 574: tProfile->Draw(""); ?

Please fix.

Actions #1

Updated by Christian Simon almost 3 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Thanks for pointing me to an actual bug in the code!

BTW: I have always been checking carefully for compiler warnings before committing code changes to the repository. For this purpose, I uncommented the line

Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Weffc++ -Wno-unused-variable -Wno-unused-parameter -Wno-sign-compare -Wno-ignored-qualifiers -Wno-overloaded-virtual")

in the general 'CMakeLists.txt'. Apparently, this prevents g++ from checking for unused variables. Which line of compiler flags in 'CMakeLists.txt' do you recommend for code development in CbmRoot?

Actions #2

Updated by Volker Friese almost 3 years ago

Which line of compiler flags in 'CMakeLists.txt' do you recommend for code development in CbmRoot?

Depends on your compiler (gcc or clang). I use, as CDash does in the nightly tests, -DCMAKE_BUILD_TYPE=PROFILE when building the system. Which compiler flags this corresponds to only Florian knows. But with this, I get the same warnings in my local build as I see in CDash (with the same compiler, of course).

Actions #3

Updated by Volker Friese almost 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF