[PATCH 27/30] Instrument compiler about code unreachability

Zdenek Kabelac <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <a10aa0c9fece5a74e30b068a688fc49979d07381.1287994530.git.zkabelac@redhat.com>
Clang needs some instrumentation for code analysis.
It might probably help also for gcc.

Signed-off-by: Zdenek Kabelac <[email protected]>
---
 daemons/clvmd/clvmd.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c
index 57f7ffe..f9096cc 100644
--- a/daemons/clvmd/clvmd.c
+++ b/daemons/clvmd/clvmd.c
@@ -491,6 +491,7 @@ int main(int argc, char *argv[])
 		DEBUGLOG("Can't initialise cluster interface\n");
 		log_error("Can't initialise cluster interface\n");
 		child_init_signal(DFAIL_CLUSTER_IF);
+		__builtin_unreachable();
 	}
 	DEBUGLOG("Cluster ready, doing some more initialisation\n");
 
@@ -505,8 +506,10 @@ int main(int argc, char *argv[])
 
 	/* Add the local socket to the list */
 	newfd = malloc(sizeof(struct local_client));
-	if (!newfd)
-	        child_init_signal(DFAIL_MALLOC);
+	if (!newfd) {
+		child_init_signal(DFAIL_MALLOC);
+		__builtin_unreachable();
+	}
 
 	newfd->fd = local_sock;
 	newfd->removeme = 0;
-- 
1.7.3.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.