Switch [libprocess] to using compiler intrinsics for unreachable, exit, and 
abort

Use compiler intrinsics for unreachable, exit, and abort
Makes the functions not need to pretend to return something while
still silencing the compiler warnings.

Replaces 25192

Review: https://reviews.apache.org/r/26101


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/92631b24
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/92631b24
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/92631b24

Branch: refs/heads/master
Commit: 92631b246e98184260189fba730fb3ca4cb50000
Parents: fc1101c
Author: Cody Maloney <[email protected]>
Authored: Mon Sep 29 12:02:48 2014 -0700
Committer: Dominic Hamon <[email protected]>
Committed: Mon Sep 29 12:02:48 2014 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/process.cpp    |  2 +-
 3rdparty/libprocess/src/subprocess.cpp | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/92631b24/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp 
b/3rdparty/libprocess/src/process.cpp
index e46e6b1..d30ed63 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -1946,7 +1946,7 @@ Socket SocketManager::accepted(int s)
     return sockets[s] = Socket(s);
   }
 
-  return UNREACHABLE(); // Quiet the compiler.
+  UNREACHABLE();
 }
 
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/92631b24/3rdparty/libprocess/src/subprocess.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/subprocess.cpp 
b/3rdparty/libprocess/src/subprocess.cpp
index 5b92200..b926923 100644
--- a/3rdparty/libprocess/src/subprocess.cpp
+++ b/3rdparty/libprocess/src/subprocess.cpp
@@ -94,7 +94,7 @@ static pid_t defaultClone(const lambda::function<int()>& func)
   } else if (pid == 0) {
     // Child.
     ::exit(func());
-    return UNREACHABLE();
+    UNREACHABLE();
   } else {
     // Parent.
     return pid;
@@ -163,8 +163,6 @@ static int childMain(
   os::execvpe(path.c_str(), argv, (*envp)());
 
   ABORT("Failed to os::execvpe in childMain\n");
-
-  return UNREACHABLE();
 }
 
 
@@ -216,7 +214,7 @@ Try<Subprocess> subprocess(
       break;
     }
     default:
-      return Try<Subprocess>(UNREACHABLE());
+      UNREACHABLE();
   }
 
   // Prepare the file descriptor(s) for stdout.
@@ -255,7 +253,7 @@ Try<Subprocess> subprocess(
       break;
     }
     default:
-      return Try<Subprocess>(UNREACHABLE());
+      UNREACHABLE();
   }
 
   // Prepare the file descriptor(s) for stderr.
@@ -294,7 +292,7 @@ Try<Subprocess> subprocess(
       break;
     }
     default:
-      return Try<Subprocess>(UNREACHABLE());
+      UNREACHABLE();
   }
 
   // TODO(jieyu): Consider using O_CLOEXEC for atomic close-on-exec.

Reply via email to