From b95e243f835a36cf3c4fd48af4d67e7d14ce77f2 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 6 Oct 2016 10:37:53 +0900 Subject: [PATCH] ompi/errhandler: silence warnings ISO C forbids mixing object pointer and function pointer --- ompi/errhandler/errhandler.h | 4 +++- ompi/errhandler/errhandler_invoke.c | 8 +++++--- ompi/mpi/cxx/cxx_glue.h | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ompi/errhandler/errhandler.h b/ompi/errhandler/errhandler.h index 9fbe05bf2e..64534c15a8 100644 --- a/ompi/errhandler/errhandler.h +++ b/ompi/errhandler/errhandler.h @@ -15,6 +15,8 @@ * Copyright (c) 2015-2016 Intel, Inc. All rights reserved. * Copyright (c) 2016 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -95,7 +97,7 @@ struct ompi_errhandler_t; * C++ invocation function signature */ typedef void (ompi_errhandler_cxx_dispatch_fn_t)(void *handle, int *err_code, - const char *message, void *fn); + const char *message, ompi_errhandler_generic_handler_fn_t *fn); /** * Back-end type for MPI_Errorhandler. diff --git a/ompi/errhandler/errhandler_invoke.c b/ompi/errhandler/errhandler_invoke.c index c20207f70b..22462a53c1 100644 --- a/ompi/errhandler/errhandler_invoke.c +++ b/ompi/errhandler/errhandler_invoke.c @@ -14,6 +14,8 @@ * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2016 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -58,7 +60,7 @@ int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object, case OMPI_ERRHANDLER_LANG_CXX: errhandler->eh_cxx_dispatch_fn(&comm, &err_code, message, - errhandler->eh_comm_fn); + (ompi_errhandler_generic_handler_fn_t *)errhandler->eh_comm_fn); break; case OMPI_ERRHANDLER_LANG_FORTRAN: @@ -78,7 +80,7 @@ int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object, case OMPI_ERRHANDLER_LANG_CXX: errhandler->eh_cxx_dispatch_fn(&win, &err_code, message, - errhandler->eh_win_fn); + (ompi_errhandler_generic_handler_fn_t *)errhandler->eh_win_fn); break; case OMPI_ERRHANDLER_LANG_FORTRAN: @@ -98,7 +100,7 @@ int ompi_errhandler_invoke(ompi_errhandler_t *errhandler, void *mpi_object, case OMPI_ERRHANDLER_LANG_CXX: errhandler->eh_cxx_dispatch_fn(&file, &err_code, message, - errhandler->eh_file_fn); + (ompi_errhandler_generic_handler_fn_t *)errhandler->eh_file_fn); break; case OMPI_ERRHANDLER_LANG_FORTRAN: diff --git a/ompi/mpi/cxx/cxx_glue.h b/ompi/mpi/cxx/cxx_glue.h index ae6a6208ae..41d64fa5bf 100644 --- a/ompi/mpi/cxx/cxx_glue.h +++ b/ompi/mpi/cxx/cxx_glue.h @@ -15,6 +15,7 @@ #define OMPI_CXX_COMM_GLUE_H #include "ompi_config.h" +#include "ompi/errhandler/errhandler.h" #include #include "mpi.h" @@ -47,7 +48,7 @@ extern struct ompi_predefined_errhandler_t ompi_mpi_errors_throw_exceptions; * C++ invocation function signature */ typedef void (ompi_errhandler_cxx_dispatch_fn_t)(void *handle, int *err_code, - const char *message, void *fn); + const char *message, ompi_errhandler_generic_handler_fn_t *fn); ompi_cxx_communicator_type_t ompi_cxx_comm_get_type (MPI_Comm comm);