From cd0f3ff41990b4123a49c09a19eca8175cc8c10a Mon Sep 17 00:00:00 2001 From: Seth Zegelstein Date: Wed, 8 Oct 2025 19:46:02 +0000 Subject: [PATCH] Fix compile warnings Signed-off-by: Seth Zegelstein --- examples/ring-reduce.cu | 3 +-- src/include/bootstrap_host_transport/env_defs_internal.h | 2 +- src/modules/bootstrap/pmix/bootstrap_pmix.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/ring-reduce.cu b/examples/ring-reduce.cu index dd94673..6c85b2b 100644 --- a/examples/ring-reduce.cu +++ b/examples/ring-reduce.cu @@ -183,8 +183,7 @@ int main(int argc, char **argv) { abort(); } } - size_t min_ints = min_size / sizeof(int); - assert(min_ints % num_blocks == 0); + assert((min_size / sizeof(int)) % num_blocks == 0); nvshmem_init(); diff --git a/src/include/bootstrap_host_transport/env_defs_internal.h b/src/include/bootstrap_host_transport/env_defs_internal.h index f99489c..91635f5 100644 --- a/src/include/bootstrap_host_transport/env_defs_internal.h +++ b/src/include/bootstrap_host_transport/env_defs_internal.h @@ -46,7 +46,7 @@ typedef const char *nvshmemi_env_string; #define NVSHFMT_long(_v) _v #define NVSHFMT_size(_v) _v #define NVSHFMT_bool(_v) (_v) ? "true" : "false" -#define NVSHFMT_string(_v) _v +#define NVSHFMT_string(_v) ((_v) ? (_v) : "") struct nvshmemi_options_s { #define NVSHMEMI_ENV_DEF(NAME, KIND, DEFAULT, CATEGORY, SHORT_DESC) nvshmemi_env_##KIND NAME; diff --git a/src/modules/bootstrap/pmix/bootstrap_pmix.c b/src/modules/bootstrap/pmix/bootstrap_pmix.c index 12f3350..eaefe24 100644 --- a/src/modules/bootstrap/pmix/bootstrap_pmix.c +++ b/src/modules/bootstrap/pmix/bootstrap_pmix.c @@ -37,8 +37,8 @@ static struct nvshmemi_options_s env_attr; desc_wrapped = bootstrap_util_wrap_string(SHORT_DESC, 80, "\t", 1); \ printf(" NVSHMEM_%-20s " BOOTPRI_##KIND " (type: %s, default: " BOOTPRI_##KIND \ ")\n\t%s\n", \ - #NAME, NVSHFMT_##KIND(env_attr.NAME), #KIND, NVSHFMT_##KIND(DEFAULT), \ - desc_wrapped); \ + #NAME, NVSHFMT_##KIND(env_attr.NAME) ? NVSHFMT_##KIND(env_attr.NAME) : "", \ + #KIND, NVSHFMT_##KIND(DEFAULT), desc_wrapped); \ free(desc_wrapped); \ break; \ case BOOTSTRAP_OPTIONS_STYLE_RST: \