Skip to content

Commit 3766868

Browse files
Silence pedantic compiler warnings. (#2580)
* Silence pedantic compiler warnings. Signed-off-by: Samuel K. Gutierrez <samuel@lanl.gov> * Address more pedantic compiler warnings. Getting closer to successfully compiling with --enable-devel-check. Signed-off-by: Samuel K. Gutierrez <samuel@lanl.gov> * Add missing copyright. Signed-off-by: Samuel K. Gutierrez <samuel@lanl.gov> * Handle error path in pmix_query_strip_local_keys(). Signed-off-by: Samuel K. Gutierrez <samuel@lanl.gov>
1 parent 958d6bb commit 3766868

File tree

5 files changed

+24
-10
lines changed

5 files changed

+24
-10
lines changed

src/common/pmix_query.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Copyright (c) 2019 Research Organization for Information Science
88
* and Technology (RIST). All rights reserved.
99
* Copyright (c) 2021-2022 Nanook Consulting All rights reserved.
10+
* Copyright (c) 2022 Triad National Security, LLC. All rights reserved.
1011
* $COPYRIGHT$
1112
*
1213
* Additional copyrights may follow
@@ -984,7 +985,7 @@ static pmix_query_t * pmix_query_strip_local_keys(pmix_query_t orig_queries[],
984985
size_t orig_nqueries,
985986
size_t nqueries)
986987
{
987-
int rc;
988+
int rc = PMIX_SUCCESS;
988989
size_t n, p, n_idx, p_idx;
989990
pmix_query_t *queries;
990991

@@ -995,13 +996,20 @@ static pmix_query_t * pmix_query_strip_local_keys(pmix_query_t orig_queries[],
995996
for (p = 0; NULL != orig_queries[n].keys[p]; p++) {
996997
if (!pmix_query_check_is_local_resolve(orig_queries[n].keys[p])) {
997998
PMIX_ARGV_APPEND(rc, queries[n_idx].keys, orig_queries[n].keys[p]);
999+
if (PMIX_SUCCESS != rc) {
1000+
goto out;
1001+
}
9981002
++p_idx;
9991003
}
10001004
}
10011005
if( p_idx > 0 ) {
10021006
++n_idx;
10031007
}
10041008
}
1005-
1009+
out:
1010+
if (PMIX_SUCCESS != rc) {
1011+
PMIX_QUERY_RELEASE(queries);
1012+
// Note that queries is set to NULL by PMIX_QUERY_RELEASE.
1013+
}
10061014
return queries;
10071015
}

src/mca/bfrops/base/bfrop_base_print.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
1414
* Copyright (c) 2016 Mellanox Technologies, Inc.
1515
* All rights reserved.
16-
*
16+
* Copyright (c) 2022 Triad National Security, LLC. All rights reserved.
1717
* Copyright (c) 2021-2022 Nanook Consulting All rights reserved.
1818
* $COPYRIGHT$
1919
*
@@ -47,7 +47,9 @@ char* PMIx_Info_string(pmix_info_t *info)
4747
PMIX_BFROPS_PRINT(rc, pmix_globals.mypeer,
4848
&output, NULL,
4949
(void*)info, PMIX_INFO);
50-
50+
if (PMIX_SUCCESS != rc) {
51+
return NULL;
52+
}
5153
return output;
5254
}
5355

@@ -59,7 +61,9 @@ char* PMIx_Value_string(pmix_value_t *value)
5961
PMIX_BFROPS_PRINT(rc, pmix_globals.mypeer,
6062
&output, NULL,
6163
(void*)value, PMIX_VALUE);
62-
64+
if (PMIX_SUCCESS != rc) {
65+
return NULL;
66+
}
6367
return output;
6468
}
6569

@@ -1604,7 +1608,7 @@ pmix_status_t pmix_bfrops_base_print_darray(char **output, char *prefix, pmix_da
16041608
pmix_data_type_t type)
16051609
{
16061610
char *prefx, *tp, *tp2=NULL, *tp3;
1607-
pmix_status_t rc;
1611+
pmix_status_t rc = PMIX_ERR_BAD_PARAM;
16081612
size_t n;
16091613
bool *bptr;
16101614
uint8_t *u8ptr;

src/mca/gds/hash/gds_hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2018-2020 Mellanox Technologies, Inc.
77
* All rights reserved.
8-
*
8+
* Copyright (c) 2022 Triad National Security, LLC. All rights reserved.
99
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
1010
* $COPYRIGHT$
1111
*
@@ -146,7 +146,7 @@ static pmix_status_t hash_cache_job_info(struct pmix_namespace_t *ns, pmix_info_
146146
pmix_job_t *trk;
147147
pmix_session_t *s = NULL, *sptr;
148148
pmix_hash_table_t *ht;
149-
pmix_kval_t *kp2, *kvptr, kv;
149+
pmix_kval_t *kp2 = NULL, *kvptr, kv;
150150
pmix_value_t val;
151151
pmix_info_t *iptr;
152152
char **nodes = NULL, **procs = NULL;

src/server/pmix_server_ops.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* All rights reserved.
1010
* Copyright (c) 2016-2020 IBM Corporation. All rights reserved.
1111
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
12+
* Copyright (c) 2022 Triad National Security, LLC. All rights reserved.
1213
* $COPYRIGHT$
1314
*
1415
* Additional copyrights may follow
@@ -3983,7 +3984,7 @@ pmix_status_t pmix_server_grpconstruct(pmix_server_caddy_t *cd, pmix_buffer_t *b
39833984
bool barrier_directive_included = false;
39843985
pmix_buffer_t bucket;
39853986
pmix_byte_object_t bo;
3986-
pmix_grpinfo_t *g;
3987+
pmix_grpinfo_t *g = NULL;
39873988
pmix_kval_t *kv;
39883989

39893990
pmix_output_verbose(2, pmix_server_globals.connect_output,

src/util/pmix_hash.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* All rights reserved.
1414
* Copyright (c) 2016 IBM Corporation. All rights reserved.
1515
* Copyright (c) 2021-2022 Nanook Consulting All rights reserved.
16+
* Copyright (c) 2022 Triad National Security, LLC. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -110,7 +111,7 @@ pmix_status_t pmix_hash_store(pmix_hash_table_t *table,
110111
pmix_status_t rc;
111112
pmix_data_array_t *darray;
112113
pmix_qual_t *qarray;
113-
size_t n, m;
114+
size_t n, m = 0;
114115

115116
pmix_output_verbose(10, pmix_globals.debug_output,
116117
"HASH:STORE:QUAL rank %s key %s",

0 commit comments

Comments
 (0)