From 1bda304a35822f1c29442ebc22dc073a3146943e Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 28 Feb 2014 17:45:36 +0000 Subject: [PATCH] Mark the ompi_rte_abort() function as "no return" This allows compilers to know that the code path(s) where ompi_rte_abort() is invoked won't return (and therefore won't warn in certain cases). cmr=v1.8:reviewer=rhc This commit was SVN r30891. --- ompi/mca/rte/orte/rte_orte.h | 4 +++- ompi/mca/rte/orte/rte_orte_module.c | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ompi/mca/rte/orte/rte_orte.h b/ompi/mca/rte/orte/rte_orte.h index 3c88c6d123..6ec9b25f51 100644 --- a/ompi/mca/rte/orte/rte_orte.h +++ b/ompi/mca/rte/orte/rte_orte.h @@ -3,6 +3,7 @@ * All rights reserved. * Copyright (c) 2013-2014 Intel, Inc. All rights reserved * + * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -76,7 +77,8 @@ typedef orte_local_rank_t ompi_local_rank_t; #define ompi_rte_proc_is_bound orte_proc_is_bound /* Error handling objects and operations */ -OMPI_DECLSPEC void ompi_rte_abort(int error_code, char *fmt, ...); +OMPI_DECLSPEC void __opal_attribute_noreturn__ + ompi_rte_abort(int error_code, char *fmt, ...); #define ompi_rte_abort_peers(a, b, c) orte_errmgr.abort_peers(a, b, c) #define OMPI_RTE_ERRHANDLER_FIRST ORTE_ERRMGR_CALLBACK_FIRST #define OMPI_RTE_ERRHANDLER_LAST ORTE_ERRMGR_CALLBACK_LAST diff --git a/ompi/mca/rte/orte/rte_orte_module.c b/ompi/mca/rte/orte/rte_orte_module.c index b751cf7e3a..880cc41bd9 100644 --- a/ompi/mca/rte/orte/rte_orte_module.c +++ b/ompi/mca/rte/orte/rte_orte_module.c @@ -2,6 +2,8 @@ * Copyright (c) 2012-2013 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2013-2014 Intel, Inc. All rights reserved + * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. + * $COPYRIGHT$ */ #include "ompi_config.h" #include "ompi/constants.h" @@ -83,7 +85,10 @@ void ompi_rte_abort(int error_code, char *fmt, ...) * We must exit in orte_ess.abort; all implementations of orte_ess.abort * contain __opal_attribute_noreturn__ */ - /* No way to reach here */ + /* No way to reach here, but put an exit() here a) just to cover + for bugs, and b) to let the compiler know we're honoring the + __opal_attribute_noreturn__. */ + exit(-1); } /*