Skip to content

Commit 3037dfd

Browse files
committed
opal/util: fix simple compiler warnings
Note that free(NULL) is legal in C99, so remove the "__opal_attribute_nonnull__(1)" attribute from the buffer param to opal_free() debug wrapper. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent bcc3b72 commit 3037dfd

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

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)