Skip to content

Commit 00b87ea

Browse files
author
rhc54
authored
Merge pull request #2584 from rhc54/topic/warnings
Reduce the flood of warnings due to uninitialized variables, mismatch…
2 parents e84f738 + 585540b commit 00b87ea

File tree

11 files changed

+26
-18
lines changed

11 files changed

+26
-18
lines changed

ompi/mca/bcol/basesmuma/bcol_basesmuma_smcm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Copyright (c) 2009-2012 Mellanox Technologies. All rights reserved.
66
* Copyright (c) 2012-2016 Los Alamos National Security, LLC. All rights
77
* reserved.
8-
* Copyright (c) 2014 Intel, Inc. All rights reserved.
8+
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
99
* Copyright (c) 2014-2015 Research Organization for Information Science
1010
* and Technology (RIST). All rights reserved.
1111
* $COPYRIGHT$
@@ -444,7 +444,7 @@ static bcol_basesmuma_smcm_mmap_t * bcol_basesmuma_smcm_reg_mmap(void *in_ptr, i
444444
/* is addr past the end of the file? */
445445
if ((unsigned char *) seg+length < myaddr) {
446446
opal_output (ompi_bcol_base_framework.framework_output, "mca_bcol_basesmuma_sm_alloc_mmap: memory region too small len %lu add %p",
447-
(unsigned long) length, myaddr);
447+
(unsigned long) length, (void*)myaddr);
448448
OBJ_RELEASE(map);
449449
munmap ((void *)seg, length);
450450
return NULL;

ompi/mca/coll/tuned/coll_tuned_module.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
13+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
1314
* $COPYRIGHT$
1415
*
1516
* Additional copyrights may follow
@@ -120,7 +121,7 @@ ompi_coll_tuned_forced_getvalues( enum COLLTYPE type,
120121
coll_tuned_force_algorithm_params_t *forced_values )
121122
{
122123
coll_tuned_force_algorithm_mca_param_indices_t* mca_params;
123-
const int *tmp;
124+
const int *tmp = NULL;
124125

125126
mca_params = &(ompi_coll_tuned_forced_params[type]);
126127

ompi/mca/osc/rdma/osc_rdma.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* reserved.
1313
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved.
15+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -325,7 +326,7 @@ static inline int _ompi_osc_rdma_register (ompi_osc_rdma_module_t *module, struc
325326
{
326327
if (module->selected_btl->btl_register_mem) {
327328
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_INFO, "registering segment with btl. range: %p - %p (%lu bytes)",
328-
ptr, (char *) ptr + size, size);
329+
ptr, (void*)((char *) ptr + size), size);
329330

330331
*handle = module->selected_btl->btl_register_mem (module->selected_btl, endpoint, ptr, size, flags);
331332
if (OPAL_UNLIKELY(NULL == *handle)) {

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* reserved.
55
* Copyright (c) 2016 Research Organization for Information Science
66
* and Technology (RIST). All rights reserved.
7+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
78
* $COPYRIGHT$
89
*
910
* Additional copyrights may follow
@@ -237,7 +238,7 @@ static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const v
237238
target_address = target_address & ~btl_alignment_mask;
238239

239240
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "initiating btl get. local: %p (handle %p), remote: 0x%" PRIx64
240-
" (handle %p)", ptr, (void *) frag->handle, target_address, (void *) target_handle);
241+
" (handle %p)", (void*)ptr, (void *) frag->handle, target_address, (void *) target_handle);
241242

242243
ret = module->selected_btl->btl_get (module->selected_btl, peer->data_endpoint, ptr,
243244
target_address, frag->handle, target_handle, aligned_len,
@@ -248,7 +249,7 @@ static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const v
248249
memcpy (ptr, source, len);
249250

250251
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "initiating btl put. local: %p (handle %p), remote: 0x%" PRIx64
251-
" (handle %p)", ptr, (void *) frag->handle, target_address, (void *) target_handle);
252+
" (handle %p)", (void*)ptr, (void *) frag->handle, target_address, (void *) target_handle);
252253

253254
ret = module->selected_btl->btl_put (module->selected_btl, peer->data_endpoint, ptr,
254255
target_address, frag->handle, target_handle, len, 0,

ompi/mca/osc/rdma/osc_rdma_comm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
44
* reserved.
5+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
56
* $COPYRIGHT$
67
*
78
* Additional copyrights may follow
@@ -50,7 +51,7 @@ int ompi_osc_get_data_blocking (ompi_osc_rdma_module_t *module, struct mca_btl_b
5051
}
5152

5253
local_handle = frag->handle;
53-
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "allocated temporary buffer %p in fragment %p", ptr,
54+
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "allocated temporary buffer %p in fragment %p", (void*)ptr,
5455
(void *) frag);
5556
}
5657

@@ -732,7 +733,7 @@ static int ompi_osc_rdma_get_contig (ompi_osc_rdma_sync_t *sync, ompi_osc_rdma_p
732733
}
733734
} else {
734735
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_TRACE, "using internal buffer %p in fragment %p for get of size %lu bytes, source address 0x%lx",
735-
ptr, (void *) frag, (unsigned long) aligned_len, (unsigned long) aligned_source_base);
736+
(void*)ptr, (void *) frag, (unsigned long) aligned_len, (unsigned long) aligned_source_base);
736737
local_handle = frag->handle;
737738
}
738739
}

ompi/mpi/tool/cvar_read.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
44
* reserved.
55
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
6+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
67
* $COPYRIGHT$
78
*
89
* Additional copyrights may follow
@@ -23,7 +24,7 @@
2324

2425
int MPI_T_cvar_read (MPI_T_cvar_handle handle, void *buf)
2526
{
26-
const mca_base_var_storage_t *value;
27+
const mca_base_var_storage_t *value = NULL;
2728
int rc = MPI_SUCCESS;
2829

2930
if (!mpit_is_initialized ()) {
@@ -38,7 +39,7 @@ int MPI_T_cvar_read (MPI_T_cvar_handle handle, void *buf)
3839

3940
do {
4041
rc = mca_base_var_get_value(handle->var->mbv_index, &value, NULL, NULL);
41-
if (OPAL_SUCCESS != rc) {
42+
if (OPAL_SUCCESS != rc || NULL == value) {
4243
/* shouldn't happen */
4344
rc = MPI_ERR_OTHER;
4445
break;

ompi/runtime/ompi_mpi_preconnect.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
88
* Copyright (c) 2007 Los Alamos National Security, LLC. All rights
99
* reserved.
10+
* Copyright (c) 2016 Intel, Inc. All rights reserved.
1011
* $COPYRIGHT$
1112
*
1213
* Additional copyrights may follow
@@ -32,12 +33,12 @@ ompi_init_preconnect_mpi(void)
3233
int param, next, prev, i, ret = OMPI_SUCCESS;
3334
struct ompi_request_t * requests[2];
3435
char inbuf[1], outbuf[1];
35-
const bool *value;
36+
const bool *value = NULL;
3637

3738
param = mca_base_var_find("ompi", "mpi", NULL, "preconnect_mpi");
3839
if (0 > param) return OMPI_SUCCESS;
3940
ret = mca_base_var_get_value(param, &value, NULL, NULL);
40-
if (OMPI_SUCCESS != ret || 0 == value[0]) {
41+
if (OMPI_SUCCESS != ret || (NULL != value && 0 == value[0])) {
4142
return OMPI_SUCCESS;
4243
}
4344

opal/mca/hwloc/base/hwloc_base_frame.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
3-
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
44
* Copyright (c) 2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* $COPYRIGHT$
@@ -313,8 +313,8 @@ static void buffer_cleanup(void *value)
313313
for (i=0; i < OPAL_HWLOC_PRINT_NUM_BUFS; i++) {
314314
free(ptr->buffers[i]);
315315
}
316+
free(ptr);
316317
}
317-
free(ptr);
318318
}
319319

320320
opal_hwloc_print_buffers_t *opal_hwloc_get_print_buffer(void)

opal/mca/mpool/hugepage/mpool_hugepage_component.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ static int mca_mpool_hugepage_close (void)
190190
return OPAL_SUCCESS;
191191
}
192192

193+
#ifdef HAVE_MNTENT_H
193194
static int page_compare (opal_list_item_t **a, opal_list_item_t **b) {
194195
mca_mpool_hugepage_hugepage_t *pagea = (mca_mpool_hugepage_hugepage_t *) *a;
195196
mca_mpool_hugepage_hugepage_t *pageb = (mca_mpool_hugepage_hugepage_t *) *b;
@@ -201,6 +202,7 @@ static int page_compare (opal_list_item_t **a, opal_list_item_t **b) {
201202

202203
return 0;
203204
}
205+
#endif
204206

205207
static void mca_mpool_hugepage_find_hugepages (void) {
206208
#ifdef HAVE_MNTENT_H

opal/mca/pmix/pmix2x/pmix/src/dstore/pmix_esh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2114,7 +2114,7 @@ static int pmix_sm_store(ns_track_elem_t *ns_info, pmix_rank_t rank, pmix_kval_t
21142114
}
21152115
} else {
21162116
char ckey[PMIX_MAX_KEYLEN+1] = {0};
2117-
strncpy(ckey, (const char *)addr, strlen(addr)+1);
2117+
strncpy(ckey, (const char *)addr, strlen((char*)addr)+1);
21182118
PMIX_OUTPUT_VERBOSE((10, pmix_globals.debug_output,
21192119
"%s:%d:%s: for rank %u, replace flag %d skip %s key, look for %s key",
21202120
__FILE__, __LINE__, __func__, rank, data_exist, ckey, kval->key));

0 commit comments

Comments
 (0)