summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2020-05-19 11:26:21 +0300
committerToomas Soome <tsoome@me.com>2020-06-03 20:38:31 +0300
commitf7c0877265657617150d9e7010f62fd4554ca9e5 (patch)
tree2ffda1f00c7236f5239ac74aadeb06e0a161d753
parent01e7b7f0889d1871183449cbcbc41e1f90f40610 (diff)
downloadillumos-joyent-f7c0877265657617150d9e7010f62fd4554ca9e5.tar.gz
12805 sun_fc: in C++11 this 'throw' will call 'terminate' because destructors default to 'noexcept'
Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com> Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/lib/sun_fc/Makefile.com4
-rw-r--r--usr/src/lib/sun_fc/common/Listener.cc17
2 files changed, 5 insertions, 16 deletions
diff --git a/usr/src/lib/sun_fc/Makefile.com b/usr/src/lib/sun_fc/Makefile.com
index 8866389598..3d0e2d3ab8 100644
--- a/usr/src/lib/sun_fc/Makefile.com
+++ b/usr/src/lib/sun_fc/Makefile.com
@@ -145,10 +145,6 @@ CCERRWARN += -_gcc=-Wno-unused-function
CCERRWARN += -_gcc=-Wno-type-limits
CCERRWARN += -_gcc=-Wno-return-type
-CCERRWARN += -_gcc7=-Wno-c++11-compat
-CCERRWARN += -_gcc8=-Wno-c++11-compat
-CCERRWARN += -_gcc9=-Wno-c++11-compat
-
LDLIBS += -ldevinfo
LDLIBS += -lsysevent
LDLIBS += -lnvpair
diff --git a/usr/src/lib/sun_fc/common/Listener.cc b/usr/src/lib/sun_fc/common/Listener.cc
index cc862aff9e..9b9f4b3fe3 100644
--- a/usr/src/lib/sun_fc/common/Listener.cc
+++ b/usr/src/lib/sun_fc/common/Listener.cc
@@ -50,7 +50,7 @@ typedef vector<Listener *>::iterator ListenerIterator;
* @memo Create a new generic listener
* @exception ... underlying exceptions will be thrown
* @param userData The opaque user data for event callback
- *
+ *
*/
Listener::Listener(void *userData) {
data = userData;
@@ -66,22 +66,15 @@ Listener::Listener(void *userData) {
/**
* @memo Free up a generic listener, keeping global list in sync.
- * @exception ... underlying exceptions will be thrown
*/
Listener::~Listener() {
Lockable::lock(&staticLock);
- try {
- for (ListenerIterator tmp = listeners.begin();
- tmp != listeners.end(); tmp++) {
+ for (ListenerIterator tmp = listeners.begin();
+ tmp != listeners.end(); tmp++) {
if (*tmp == this) {
- listeners.erase(tmp);
- Lockable::unlock(&staticLock);
- return;
+ listeners.erase(tmp);
+ break;
}
- }
- } catch (...) {
- Lockable::unlock(&staticLock);
- throw;
}
Lockable::unlock(&staticLock);
}