Correcting compilation warnings before Release 2023.06.0
Please, correct the following compilation warnings:
-
MpdUnigenGenerator:
/home/soul/bmnroot/generators/MpdUnigenGenerator.h:82:3: warning: 'CheckTObjectHashConsistency' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
ClassDef(MpdUnigenGenerator, 1);
/home/soul/bmnroot/generators/MpdUnigenGenerator.h:82:3: warning: 'IsA' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
ClassDef(MpdUnigenGenerator, 1);
/home/soul/bmnroot/generators/MpdUnigenGenerator.h:82:3: warning: 'ShowMembers' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
ClassDef(MpdUnigenGenerator, 1);
/home/soul/bmnroot/generators/MpdUnigenGenerator.h:82:3: warning: 'Streamer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
ClassDef(MpdUnigenGenerator, 1);
/home/soul/bmnroot/generators/MpdUnigenGenerator.cxx:158:15: warning: declaration of ‘mass’ shadows a previous local [-Wshadow]
158 | Int_t mass = GetIonMass(ionPdg);
| ^~~~
/home/soul/bmnroot/generators/MpdUnigenGenerator.cxx:128:14: note: shadowed declaration is here
128 | Double_t mass = fParticle->GetMomentum().M();
-
BmnZdc:
/home/soul/bmnroot/detectors/zdc/BmnZdc.cxx:319:46: warning: ‘void FairLogger::Info(const char*, const char*, const char*, const char*, ...)’ is deprecated: Use 'LOG(info) << content;' macro interface instead. [-Wdeprecated-declarations]
319 | FairLogger::GetLogger()->Info(MESSAGE_ORIGIN, "Constructing ZDC geometry from ROOT file %s", fileName.Data());
-
Decoder:
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx: In member function ‘void BmnTof2Raw2DigitNew::drawprep()’:
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3519:11: warning: ‘void* memcpy(void*, const void*, size_t)’ reading 236 bytes from a region of size 60 [-Wstringop-overread]
3519 | memcpy(champosn, champos, sizeof champosn);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3516:9: note: source object ‘champos’ of size 60
3516 | int champos[] = {5,10,1,6,11,2,7,12,3,8,13,4,9,14,0};
| ^~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3526:11: warning: ‘void* memcpy(void*, const void*, size_t)’ reading 236 bytes from a region of size 96 [-Wstringop-overread]
3526 | memcpy(champosn, champos, sizeof champosn);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3523:9: note: source object ‘champos’ of size 96
3523 | int champos[] = {17,18, 3, 1,19, 4,23,20, 5,15,21, 6, 2,22, 9,10,11,12,13,14, 7, 8, 0,16};
| ^~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx: In member function ‘void BmnTof2Raw2DigitNew::drawprof()’:
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3698:11: warning: ‘void* memcpy(void*, const void*, size_t)’ reading 236 bytes from a region of size 60 [-Wstringop-overread]
3698 | memcpy(champosn, champos, sizeof champosn);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3695:9: note: source object ‘champos’ of size 60
3695 | int champos[] = {5,10,1,6,11,2,7,12,3,8,13,4,9,14,0};
| ^~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3705:11: warning: ‘void* memcpy(void*, const void*, size_t)’ reading 236 bytes from a region of size 96 [-Wstringop-overread]
3705 | memcpy(champosn, champos, sizeof champosn);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3702:9: note: source object ‘champos’ of size 96
3702 | int champos[] = {17,18, 3, 1,19, 4,23,20, 5,15,21, 6, 2,22, 9,10,11,12,13,14, 7, 8, 0,16};
| ^~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx: In member function ‘void BmnTof2Raw2DigitNew::drawproft0()’:
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3750:11: warning: ‘void* memcpy(void*, const void*, size_t)’ reading 236 bytes from a region of size 60 [-Wstringop-overread]
3750 | memcpy(champosn, champos, sizeof champosn);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3747:9: note: source object ‘champos’ of size 60
3747 | int champos[] = {5,10,1,6,11,2,7,12,3,8,13,4,9,14,0};
| ^~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3757:11: warning: ‘void* memcpy(void*, const void*, size_t)’ reading 236 bytes from a region of size 96 [-Wstringop-overread]
3757 | memcpy(champosn, champos, sizeof champosn);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/soul/bmnroot/decoder/BmnTof2Raw2DigitNew.cxx:3754:9: note: source object ‘champos’ of size 96
3754 | int champos[] = {17,18, 3, 1,19, 4,23,20, 5,15,21, 6, 2,22, 9,10,11,12,13,14, 7, 8, 0,16};
/home/soul/bmnroot/decoder/WfmProcessor.cxx: In member function ‘void WfmProcessor::ProcessWfm(std::vector<float>, BmnDigiContainerTemplate*)’:
/home/soul/bmnroot/decoder/WfmProcessor.cxx:23:32: warning: ‘std::binder1st<_Operation> std::bind1st(const _Operation&, const _Tp&) [with _Operation = multiplies<float>; _Tp = float]’ is deprecated: use 'std::bind' instead [-Wdeprecated-declarations]
23 | std::bind1st(std::multiplies<float>(), myconstant));
-
QA:
/home/soul/bmnroot/QA/report/BmnHistManager.cxx:31:16: warning: ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’ is deprecated [-Wdeprecated-declarations]
31 | public std::binary_function<
-
SRC:
/home/soul/bmnroot/macro/src/srcAnalysis/tracking/track_arms.cpp: In function ‘int main(int, char**)’:
/home/soul/bmnroot/macro/src/srcAnalysis/tracking/track_arms.cpp:244:35: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 8 [-Wformat-overflow=]
244 | sprintf(temp,"mx%d",i);
| ^~
/home/soul/bmnroot/macro/src/srcAnalysis/tracking/track_arms.cpp:244:32: note: directive argument in the range [0, 1073741822]
244 | sprintf(temp,"mx%d",i);
| ^~~~~~
/home/soul/bmnroot/macro/src/srcAnalysis/tracking/track_arms.cpp:244:26: note: ‘sprintf’ output between 4 and 13 bytes into a destination of size 10
244 | sprintf(temp,"mx%d",i);
| ~~~~~~~^~~~~~~~~~~~~~~
/home/soul/bmnroot/macro/src/srcAnalysis/tracking/track_arms.cpp:249:35: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 8 [-Wformat-overflow=]
249 | sprintf(temp,"my%d",i);
| ^~
/home/soul/bmnroot/macro/src/srcAnalysis/tracking/track_arms.cpp:249:32: note: directive argument in the range [0, 1073741822]
249 | sprintf(temp,"my%d",i);
| ^~~~~~
/home/soul/bmnroot/macro/src/srcAnalysis/tracking/track_arms.cpp:249:26: note: ‘sprintf’ output between 4 and 13 bytes into a destination of size 10
249 | sprintf(temp,"my%d",i);
Edited by Ilnour Gabdrakhmanov