Development #1368
closedDevelopment #1353: Code cleanup for OCT19
Code cleanup: beamtime/tof/display/CbmTofOnlineDisplay.cxx
100%
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.
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?
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).
Updated by Volker Friese almost 3 years ago
- Status changed from Resolved to Closed