Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix many compiler warnings #8203

Merged
merged 1 commit into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ AC_CHECK_SIZEOF(_Bool)
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(long long)
if test "$ac_cv_type_short_float" = yes; then
AC_CHECK_SIZEOF(short float)
Expand Down
4 changes: 2 additions & 2 deletions ompi/dpm/dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2018 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2007-2020 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2006-2009 University of Houston. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights
Expand Down Expand Up @@ -651,7 +651,7 @@ static int dpm_convert(opal_list_t *infos,
bool deprecated)
{
opal_info_item_t *iptr;
char *ck, *ptr, *help_str;
char *ck, *ptr, *help_str = NULL;
jsquyres marked this conversation as resolved.
Show resolved Hide resolved
int rc;
char **tmp;
dpm_conflicts_t *modifiers;
Expand Down
4 changes: 2 additions & 2 deletions ompi/errhandler/errhandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2018 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
Expand Down Expand Up @@ -282,7 +282,7 @@ static void *ompi_errhandler_event_cb(int fd, int flags, void *context) {
/* TODO: this error should return to the caller and invoke an error
* handler from the MPI API call.
* For now, it is fatal. */
ompi_mpi_errors_are_fatal_comm_handler(NULL, status, "PMIx Even Notification");
ompi_mpi_errors_are_fatal_comm_handler(NULL, &status, "PMIx Event Notification");
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/coll/adapt/coll_adapt_ireduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, int count,
OPAL_OUTPUT_VERBOSE((30, mca_coll_adapt_component.adapt_output,
"[%d]: distance %d, inbuf %p, inbuf->buff %p, inbuf->buff-lb %p, to_inbuf %p, inbuf_list %p\n",
rank, con->distance, (void *) temp_inbuf, (void *) temp_inbuf->buff,
(char *) temp_inbuf->buff - lower_bound,
(void *) ((char *) temp_inbuf->buff - lower_bound),
(void *) to_inbuf((char *) temp_inbuf->buff - lower_bound, con->distance),
(void *) &con->inbuf_list));
opal_free_list_return_st(&con->inbuf_list, (opal_free_list_item_t *) temp_inbuf);
Expand Down
5 changes: 4 additions & 1 deletion ompi/mca/common/monitoring/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Copyright (c) 2016 Inria. All rights reserved.
# Copyright (c) 2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2018 Cisco Systems, Inc. All rights reserved
# Copyright (c) 2018-2020 Cisco Systems, Inc. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -28,6 +28,9 @@ lib_LTLIBRARIES += $(component_install)
lib_LTLIBRARIES += ompi_monitoring_prof.la

ompi_monitoring_prof_la_SOURCES = monitoring_prof.c
if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS
ompi_monitoring_prof_la_SOURCES += monitoring_prof_f.c
endif
ompi_monitoring_prof_la_LDFLAGS= \
-module -avoid-version -shared $(WRAPPER_EXTRA_LDFLAGS)
ompi_monitoring_prof_la_LIBADD = \
Expand Down
58 changes: 1 addition & 57 deletions ompi/mca/common/monitoring/monitoring_prof.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* reserved.
jsquyres marked this conversation as resolved.
Show resolved Hide resolved
* Copyright (c) 2013-2017 Inria. All rights reserved.
* Copyright (c) 2013-2015 Bull SAS. All rights reserved.
* Copyright (c) 2016-2018 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2016-2020 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -398,59 +398,3 @@ int write_mat(char * filename, size_t * mat, unsigned int dim)

return 0;
}

/**
* MPI binding for fortran
*/

void monitoring_prof_mpi_init_f2c( MPI_Fint * );
void monitoring_prof_mpi_finalize_f2c( MPI_Fint * );

void monitoring_prof_mpi_init_f2c( MPI_Fint *ierr ) {
int c_ierr;
int argc = 0;
char ** argv = NULL;

c_ierr = MPI_Init(&argc, &argv);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}

void monitoring_prof_mpi_finalize_f2c( MPI_Fint *ierr ) {
int c_ierr;

c_ierr = MPI_Finalize();
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}

#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_INIT = monitoring_prof_mpi_init_f2c
#pragma weak mpi_init = monitoring_prof_mpi_init_f2c
#pragma weak mpi_init_ = monitoring_prof_mpi_init_f2c
#pragma weak mpi_init__ = monitoring_prof_mpi_init_f2c
#pragma weak MPI_Init_f = monitoring_prof_mpi_init_f2c
#pragma weak MPI_Init_f08 = monitoring_prof_mpi_init_f2c

#pragma weak MPI_FINALIZE = monitoring_prof_mpi_finalize_f2c
#pragma weak mpi_finalize = monitoring_prof_mpi_finalize_f2c
#pragma weak mpi_finalize_ = monitoring_prof_mpi_finalize_f2c
#pragma weak mpi_finalize__ = monitoring_prof_mpi_finalize_f2c
#pragma weak MPI_Finalize_f = monitoring_prof_mpi_finalize_f2c
#pragma weak MPI_Finalize_f08 = monitoring_prof_mpi_finalize_f2c
#elif OMPI_BUILD_FORTRAN_BINDINGS

OMPI_GENERATE_F77_BINDINGS (MPI_INIT,
mpi_init,
mpi_init_,
mpi_init__,
monitoring_prof_mpi_init_f2c,
(MPI_Fint *ierr),
(ierr) )

OMPI_GENERATE_F77_BINDINGS (MPI_FINALIZE,
mpi_finalize,
mpi_finalize_,
mpi_finalize__,
monitoring_prof_mpi_finalize_f2c,
(MPI_Fint *ierr),
(ierr) )
#endif
82 changes: 82 additions & 0 deletions ompi/mca/common/monitoring/monitoring_prof_f.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Copyright (c) 2013-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2013-2017 Inria. All rights reserved.
* Copyright (c) 2013-2015 Bull SAS. All rights reserved.
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/

/*
* MPI binding for fortran
*/

#define OMPI_BUILD_MPI_PROFILING 0
#define OMPI_COMPILING_FORTRAN_WRAPPERS 1

#include <stdbool.h>

#include "ompi_config.h"

#include "ompi/mpi/fortran/mpif-h/bindings.h"
#include "ompi/mpi/fortran/base/constants.h"


void monitoring_prof_mpi_init_f2c( MPI_Fint * );
void monitoring_prof_mpi_finalize_f2c( MPI_Fint * );

void monitoring_prof_mpi_init_f2c( MPI_Fint *ierr ) {
int c_ierr;
int argc = 0;
char ** argv = NULL;

c_ierr = PMPI_Init(&argc, &argv);
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}

void monitoring_prof_mpi_finalize_f2c( MPI_Fint *ierr ) {
int c_ierr;

c_ierr = PMPI_Finalize();
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
}

#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_INIT = monitoring_prof_mpi_init_f2c
#pragma weak mpi_init = monitoring_prof_mpi_init_f2c
#pragma weak mpi_init_ = monitoring_prof_mpi_init_f2c
#pragma weak mpi_init__ = monitoring_prof_mpi_init_f2c
#pragma weak MPI_Init_f = monitoring_prof_mpi_init_f2c
#pragma weak MPI_Init_f08 = monitoring_prof_mpi_init_f2c

#pragma weak MPI_FINALIZE = monitoring_prof_mpi_finalize_f2c
#pragma weak mpi_finalize = monitoring_prof_mpi_finalize_f2c
#pragma weak mpi_finalize_ = monitoring_prof_mpi_finalize_f2c
#pragma weak mpi_finalize__ = monitoring_prof_mpi_finalize_f2c
#pragma weak MPI_Finalize_f = monitoring_prof_mpi_finalize_f2c
#pragma weak MPI_Finalize_f08 = monitoring_prof_mpi_finalize_f2c
#else

OMPI_GENERATE_F77_BINDINGS (MPI_INIT,
mpi_init,
mpi_init_,
mpi_init__,
monitoring_prof_mpi_init_f2c,
(MPI_Fint *ierr),
(ierr) )

OMPI_GENERATE_F77_BINDINGS (MPI_FINALIZE,
mpi_finalize,
mpi_finalize_,
mpi_finalize__,
monitoring_prof_mpi_finalize_f2c,
(MPI_Fint *ierr),
(ierr) )
#endif
5 changes: 3 additions & 2 deletions ompi/mca/osc/rdma/osc_rdma_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2020 Google, LLC. All rights reserved.
* Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -23,7 +24,7 @@ struct ompi_osc_rdma_peer_t;
#if OPAL_HAVE_ATOMIC_MATH_64

typedef int64_t osc_rdma_base_t;
typedef int64_t osc_rdma_size_t;
typedef uint64_t osc_rdma_size_t;
typedef int64_t osc_rdma_counter_t;
typedef opal_atomic_int64_t osc_rdma_atomic_counter_t;

Expand All @@ -32,7 +33,7 @@ typedef opal_atomic_int64_t osc_rdma_atomic_counter_t;
#else

typedef int32_t osc_rdma_base_t;
typedef int32_t osc_rdma_size_t;
typedef uint32_t osc_rdma_size_t;
typedef int32_t osc_rdma_counter_t;
typedef opal_atomic_int32_t osc_rdma_atomic_counter_t;

Expand Down
4 changes: 2 additions & 2 deletions ompi/mca/pml/base/pml_base_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015-2020 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2020 Amazon.com, Inc. or its affiliates. All Rights
* reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -368,7 +368,7 @@ mca_pml_base_pml_check_selected_impl(const char *my_pml,
/* if that module doesn't match my own, return an error */
if ((size != strlen(my_pml) + 1) ||
(0 != strcmp(my_pml, remote_pml))) {
char *errhost;
char *errhost = NULL;
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, PMIX_HOSTNAME, &proc_name,
&(errhost), PMIX_STRING);
opal_output(0, "%s selected pml %s, but peer %s on %s selected pml %s",
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/topo/treematch/treematch/tm_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ void group_nodes(tm_affinity_mat_t *aff_mat, tm_tree_t *tab_node, tm_tree_t *new
best_selection = (group_list_t **)MALLOC(sizeof(group_list_t*)*solution_size);

list_all_possible_groups(cost_mat, tab_node, 0, arity, 0, cur_group, &list);
assert( (int)list.val == nb_groups);
assert( list.val == nb_groups);
tab_group = (group_list_t**)MALLOC(sizeof(group_list_t*)*nb_groups);
list_to_tab(list.next, tab_group, nb_groups);
if(verbose_level>=INFO)
Expand Down
4 changes: 2 additions & 2 deletions ompi/tools/mpisync/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, LLC.
# All rights reserved.
Expand All @@ -33,7 +33,7 @@ AM_CFLAGS = \
-DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \
-DOMPI_BUILD_HOST="\"`(hostname || uname -n) | sed 1q`\"" \
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) | sed 1q`}\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
Expand Down
4 changes: 2 additions & 2 deletions ompi/tools/ompi_info/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
# Copyright (c) 2012 Los Alamos National Security, LLC.
# All rights reserved.
Expand All @@ -29,7 +29,7 @@ AM_CFLAGS = \
-DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
-DOMPI_BUILD_USER="\"$$USER\"" \
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) | sed 1q`}\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
Expand Down
3 changes: 2 additions & 1 deletion opal/datatype/opal_datatype_pack.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
* Copyright (c) 2017-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -68,7 +69,7 @@ pack_partial_blocklen( opal_convertor_t* CONVERTOR,
OPAL_DATATYPE_SAFEGUARD_POINTER( _memory, do_now_bytes, (CONVERTOR)->pBaseBuf,
(CONVERTOR)->pDesc, (CONVERTOR)->count );
DO_DEBUG( opal_output( 0, "pack memcpy( %p, %p, %lu ) => space %lu [partial]\n",
_packed, (void*)_memory, (unsigned long)do_now_bytes, (unsigned long)(*(SPACE)) ); );
(void*) _packed, (void*)_memory, (unsigned long)do_now_bytes, (unsigned long)(*(SPACE)) ); );
MEMCPY_CSUM( _packed, _memory, do_now_bytes, (CONVERTOR) );
*(memory) += (ptrdiff_t)do_now_bytes;
if( do_now == left_in_block ) /* compensate if completed a blocklen */
Expand Down
14 changes: 12 additions & 2 deletions opal/mca/base/mca_base_alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,23 @@ static char *mca_base_alias_generate_name (const char *project, const char *fram

if (project_length) {
strncat (tmp, project, length);
strncat (tmp, "_", 1);
jsquyres marked this conversation as resolved.
Show resolved Hide resolved
// NOTE: We use strcat() here (and not strncat()) because
// we're appending a constant string with a fixed/hard-coded
// length. It's the exact equivalent of strncat(tmp, "_", 1),
// but strncat() would actually be more overhead. Indeed, GCC
// 10 emits a warning if we use strncatd() with a compile-time
// constant string as the source and a hard-coded length that
// is equivalent to the length of that compile-time constant
// string. So avoid the warning and use strcat().
strcat (tmp, "_");
length -= project_length + 1;
}

if (framework_length) {
strncat (tmp, framework, length);
strncat (tmp, "_", 1);
// Use strcat() here instead of strncat(); see the comment
// above for an explanation.
strcat (tmp, "_");
length -= framework_length + 1;
}

Expand Down
Loading