New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore mutable and static warnings for std::atomic<>, std::mutex, std::r... #1241
Conversation
…::recursive_mutex, boost::thread_specific_ptr<>
A new Pull Request was created by @gartung (Patrick Gartung) for CMSSW_7_0_X. ignore mutable and static warnings for std::atomic<>, std::mutex, std::r... It involves the following packages: Utilities/StaticAnalyzers @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please review it and eventually sign? Thanks. |
Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again. |
Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again. |
Also noticed the number of FunctionChecker warnings was large. The additional commits are to bring that number down. |
std::string btsp = "boost::thread_specific_ptr<"; | ||
|
||
if ( name.substr(0,atomic.length()) == atomic || name.substr(0,mutex.length()) == mutex | ||
|| name.substr(0,rmutex.length()) == rmutex || name.substr(0,btsp.length()) == btsp ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly certain substr is a const member function so there is no need to copy 'd' to 'name'. Also, it would be better to move the immutable strings outside the function and declare them as class const statics
static const std::string kAtomic("std::atomic<");
I'd also recommend starting them with 'k' since that is often used to denote a 'konstant' in our code.
Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again. |
1 similar comment
Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again. |
To be more precise: |
Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again. |
Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again. |
Static Analyzer improvement -- ignore mutable and static warnings for std::atomic<>, std::mutex, ...
...ecursive_mutex, boost::thread_specific_ptr<>