Skip to content
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

Merged
merged 5 commits into from Oct 31, 2013
Merged

ignore mutable and static warnings for std::atomic<>, std::mutex, std::r... #1241

merged 5 commits into from Oct 31, 2013

Conversation

gartung
Copy link
Member

@gartung gartung commented Oct 30, 2013

...ecursive_mutex, boost::thread_specific_ptr<>

…::recursive_mutex, boost::thread_specific_ptr<>
@cmsbuild
Copy link
Contributor

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.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@ktf you are the release manager for this.

@cmsbuild
Copy link
Contributor

Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again.

@cmsbuild
Copy link
Contributor

Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again.

@gartung
Copy link
Member Author

gartung commented Oct 30, 2013

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 )
Copy link
Contributor

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.

@cmsbuild
Copy link
Contributor

Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again.

1 similar comment
@cmsbuild
Copy link
Contributor

Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again.

@Dr15Jones
Copy link
Contributor

To be more precise:
statics and const casts are potential problems where ever they appear.
Bad behavior from const functions, e.g. mutables, returning pointers to member data, are probably only problems for data types.

@cmsbuild
Copy link
Contributor

Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again.

@cmsbuild
Copy link
Contributor

Pull request #1241 was updated. @smuzaffar, @Dr15Jones, @ktf, @nclopezo can you please check and sign again.

@cmsbuild
Copy link
Contributor

ktf added a commit that referenced this pull request Oct 31, 2013
Static Analyzer improvement -- ignore mutable and static warnings for std::atomic<>, std::mutex, ...
@ktf ktf merged commit bbcec13 into cms-sw:CMSSW_7_0_X Oct 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants