diff --git a/opal/runtime/opal_params_core.c b/opal/runtime/opal_params_core.c index 9cbc0ef86c9..8a24db69510 100644 --- a/opal/runtime/opal_params_core.c +++ b/opal/runtime/opal_params_core.c @@ -17,9 +17,9 @@ * Copyright (c) 2010-2014 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2014 Hochschule Esslingen. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2023 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015 Mellanox Technologies, Inc. + * Copyright (c) 2015-2023 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. * Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved. @@ -89,10 +89,11 @@ static bool opal_register_util_done = false; static char *opal_var_dump_color_string = NULL; -static char *opal_var_dump_color_keys[OPAL_VAR_DUMP_COLOR_KEY_COUNT] = { +static char *opal_var_dump_color_keys[OPAL_VAR_DUMP_COLOR_ARR_SIZE] = { [OPAL_VAR_DUMP_COLOR_VAR_NAME] = "name", [OPAL_VAR_DUMP_COLOR_VAR_VALUE] = "value", - [OPAL_VAR_DUMP_COLOR_VALID_VALUES] = "valid_values" + [OPAL_VAR_DUMP_COLOR_VALID_VALUES] = "valid_values", + [OPAL_VAR_DUMP_COLOR_KEY_COUNT] = NULL }; /** diff --git a/opal/runtime/opal_params_core.h b/opal/runtime/opal_params_core.h index bdf0a580a7e..2f83e4db1ca 100644 --- a/opal/runtime/opal_params_core.h +++ b/opal/runtime/opal_params_core.h @@ -16,7 +16,7 @@ * Copyright (c) 2010-2013 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2014 Hochschule Esslingen. All rights reserved. - * Copyright (c) 2015 Mellanox Technologies, Inc. + * Copyright (c) 2015-2023 Mellanox Technologies, Inc. * All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. * Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. @@ -46,6 +46,7 @@ typedef enum { OPAL_VAR_DUMP_COLOR_KEY_COUNT } opal_var_dump_color_key_t; +#define OPAL_VAR_DUMP_COLOR_ARR_SIZE (OPAL_VAR_DUMP_COLOR_KEY_COUNT + 1) extern char *opal_var_dump_color[OPAL_VAR_DUMP_COLOR_KEY_COUNT]; # if OPAL_ENABLE_TIMING