Skip to content

Commit 65cf76e

Browse files
authored
Merge pull request #9814 from jsquyres/pr/fix-compiler-warnings
Fix compiler warnings
2 parents bcc3b72 + a24846e commit 65cf76e

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
@@ -990,15 +990,16 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
990990
switch (hdr->type) {
991991
case MCA_BTL_BASE_AM_ATOMIC:
992992
if (4 == hdr->data.atomic.size) {
993-
uint32_t tmp = (uint32_t) atomic_response;
994-
mca_btl_base_am_atomic_32(&tmp, (opal_atomic_int32_t *) (uintptr_t) hdr->target_address,
993+
int32_t tmp = (int32_t) atomic_response;
994+
mca_btl_base_am_atomic_32(&tmp, (opal_atomic_int32_t *) hdr->target_address,
995995
hdr->data.atomic.op);
996996
atomic_response = tmp;
997-
}
998-
if (8 == hdr->data.atomic.size) {
999-
mca_btl_base_am_atomic_64(&atomic_response,
1000-
(opal_atomic_int64_t *) (uintptr_t) hdr->target_address,
997+
} else if (8 == hdr->data.atomic.size) {
998+
int64_t tmp = (int64_t) atomic_response;
999+
mca_btl_base_am_atomic_64(&tmp,
1000+
(opal_atomic_int64_t *) hdr->target_address,
10011001
hdr->data.atomic.op);
1002+
atomic_response = tmp;
10021003
}
10031004
break;
10041005
case MCA_BTL_BASE_AM_CAS:
@@ -1007,8 +1008,7 @@ static void mca_btl_base_am_process_atomic(mca_btl_base_module_t *btl,
10071008
opal_atomic_compare_exchange_strong_32((opal_atomic_int32_t *) hdr->target_address,
10081009
&tmp, (int32_t) hdr->data.atomic.operand[1]);
10091010
atomic_response = tmp;
1010-
}
1011-
if (8 == hdr->data.atomic.size) {
1011+
} else if (8 == hdr->data.atomic.size) {
10121012
opal_atomic_compare_exchange_strong_64((opal_atomic_int64_t *) hdr->target_address,
10131013
&atomic_response, hdr->data.atomic.operand[1]);
10141014
}

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)