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

Don't throw exceptions in destructors #334

Merged
merged 2 commits into from
Feb 17, 2016
Merged

Conversation

ellert
Copy link
Contributor

@ellert ellert commented Feb 13, 2016

Throwing exceptions in a destructor causes warnings with gcc 6, and since -Werror is used this becomes an error:

XrdSys/XrdSysPthread.hh: In destructor 'XrdSysSemaphore::~XrdSysSemaphore()':
XrdSys/XrdSysPthread.hh:356:31: error: throw will always call terminate() [-Werror=terminate]
XrdSys/XrdSysPthread.hh:356:31: note: in C++11 destructors default to noexcept

There are two destructors in the code that does this. This pull request comments out these lines of code.

@abh3
Copy link
Member

abh3 commented Feb 14, 2016

Thanks for the update. We found the same problem a couple of weeks ago and haven't pushed the fix into the repo yet. Our solution was to replace the throw with an abort which is equivalent to what we really wanted.

simonmichal added a commit that referenced this pull request Feb 17, 2016
Don't throw exceptions in destructors
@simonmichal simonmichal merged commit f18cc4c into xrootd:master Feb 17, 2016
@ellert ellert deleted the throw-dtor branch February 17, 2016 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants