Skip to content

Commit 25f3ebd

Browse files
authored
Merge pull request #9830 from jsquyres/pr/v5.0/compiler-warning-fixes
v5.0.x: compiler warning fixes
2 parents 918bc12 + b1dc6fb commit 25f3ebd

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

opal/mca/btl/base/btl_base_am_rdma.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2011-2018 Los Alamos National Security, LLC. All rights
44
* reserved.
55
* Copyright (c) 2020-2021 Google, LLC. All rights reserved.
6-
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved
6+
* Copyright (c) 2021-2022 Cisco Systems, Inc. All rights reserved
77
* $COPYRIGHT$
88
*
99
* Additional copyrights may follow
@@ -976,15 +976,16 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
976976
switch (hdr->type) {
977977
case MCA_BTL_BASE_AM_ATOMIC:
978978
if (4 == hdr->data.atomic.size) {
979-
uint32_t tmp = (uint32_t) atomic_response;
980-
mca_btl_base_am_atomic_32(&tmp, (opal_atomic_int32_t *) (uintptr_t) hdr->target_address,
979+
int32_t tmp = (int32_t) atomic_response;
980+
mca_btl_base_am_atomic_32(&tmp, (opal_atomic_int32_t *) hdr->target_address,
981981
hdr->data.atomic.op);
982982
atomic_response = tmp;
983-
}
984-
if (8 == hdr->data.atomic.size) {
985-
mca_btl_base_am_atomic_64(&atomic_response,
986-
(opal_atomic_int64_t *) (uintptr_t) hdr->target_address,
983+
} else if (8 == hdr->data.atomic.size) {
984+
int64_t tmp = (int64_t) atomic_response;
985+
mca_btl_base_am_atomic_64(&tmp,
986+
(opal_atomic_int64_t *) hdr->target_address,
987987
hdr->data.atomic.op);
988+
atomic_response = tmp;
988989
}
989990
break;
990991
case MCA_BTL_BASE_AM_CAS:
@@ -993,8 +994,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
993994
opal_atomic_compare_exchange_strong_32((opal_atomic_int32_t *) hdr->target_address,
994995
&tmp, (int32_t) hdr->data.atomic.operand[1]);
995996
atomic_response = tmp;
996-
}
997-
if (8 == hdr->data.atomic.size) {
997+
} else if (8 == hdr->data.atomic.size) {
998998
opal_atomic_compare_exchange_strong_64((opal_atomic_int64_t *) hdr->target_address,
999999
&atomic_response, hdr->data.atomic.operand[1]);
10001000
}

opal/util/malloc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* All rights reserved.
1313
* Copyright (c) 2018 Triad National Security, LLC. All rights
1414
* reserved.
15+
* Copyright (c) 2022 Cisco Systems, Inc. All rights reserved
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -127,7 +128,7 @@ OPAL_DECLSPEC void *opal_realloc(void *ptr, size_t size, const char *file, int l
127128
* to configure (or by default if you're building in a SVN
128129
* checkout).
129130
*/
130-
OPAL_DECLSPEC void opal_free(void *addr, const char *file, int line) __opal_attribute_nonnull__(1);
131+
OPAL_DECLSPEC void opal_free(void *addr, const char *file, int line);
131132

132133
/**
133134
* Used to set the debug level for malloc debug.

opal/util/stacktrace.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
13-
* Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2008-2022 Cisco Systems, Inc. All rights reserved
1414
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1515
* Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
1616
* Copyright (c) 2019 Triad National Security, LLC. All rights
@@ -640,7 +640,6 @@ int opal_util_register_stackhandlers(void)
640640
set_stacktrace_filename();
641641
opal_stacktrace_output_fileno = -1;
642642
} else if (0 == strncasecmp(opal_stacktrace_output_filename, "file:", 5)) {
643-
char *filename_cpy = NULL;
644643
next = strchr(opal_stacktrace_output_filename, ':');
645644
next++; // move past the ':' to the filename specified
646645

@@ -654,8 +653,6 @@ int opal_util_register_stackhandlers(void)
654653
sizeof(char) * opal_stacktrace_output_filename_max_len);
655654
set_stacktrace_filename();
656655
opal_stacktrace_output_fileno = -1;
657-
658-
free(filename_cpy);
659656
} else {
660657
opal_stacktrace_output_fileno = fileno(stderr);
661658
}

0 commit comments

Comments
 (0)