cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.08k stars 4.32k forks source link

Wrong memset usage in HistoData [Validation/RecoParticleFlow/bin/include/HistoData.h] #14221

Closed davidlt closed 5 years ago

davidlt commented 8 years ago

Clang rightfully complains about:

Validation/RecoParticleFlow/bin/include/HistoData.h:93:25: warning: destination for this 'memset' call is a pointer to dynamic class 'HistoData'; vtable pointer will be overwritten [-Wdynamic-class-memaccess]
Validation/RecoParticleFlow/bin/include/HistoData.h:93:25: warning: destination for this 'memset' call is a pointer to dynamic class 'HistoData'; vtable pointer will be overwritten [-Wdynamic-class-memaccess]
Validation/RecoParticleFlow/bin/include/HistoData.h:93:25: warning: destination for this 'memset' call is a pointer to dynamic class 'HistoData'; vtable pointer will be overwritten [-Wdynamic-class-memaccess]

This is wrong:

 93   void clear() { memset(this,0,sizeof(*this)); }
cmsbuild commented 8 years ago

A new Issue was created by @davidlt .

@davidlange6, @smuzaffar, @degano, @davidlt, @Dr15Jones can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

davidlt commented 8 years ago

assign DQM

smuzaffar commented 5 years ago

this was fixed by https://github.com/cms-sw/cmssw/pull/22490