From 200128dbafea16d19ea2f160d8df81ad4ca61fff Mon Sep 17 00:00:00 2001 From: Morris Jette <jette@schedmd.com> Date: Mon, 16 Sep 2013 14:06:12 -0700 Subject: [PATCH] Eliminate compiler warnings on 32-bit systems Add type casting to eliminate some compiler warnings on 32-bit systems --- contribs/pmi2/pmi2_util.c | 6 ++++-- contribs/pmi2/pmi2_util.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contribs/pmi2/pmi2_util.c b/contribs/pmi2/pmi2_util.c index 4b1cbe7496c..4d35e20002a 100644 --- a/contribs/pmi2/pmi2_util.c +++ b/contribs/pmi2/pmi2_util.c @@ -146,7 +146,8 @@ int PMI2U_parse_keyvals(char *st) { p++; /* got non-blank */ if (*p == '=') { - PMI2U_printf("PMI2U_parse_keyvals: unexpected = at character %ld in %s", p - st, st); + PMI2U_printf("PMI2U_parse_keyvals: unexpected = at character %ld in %s", + (long int) (p - st), st); return (-1); } if (*p == '\n' || *p == '\0') @@ -156,7 +157,8 @@ int PMI2U_parse_keyvals(char *st) { while (*p != ' ' && *p != '=' && *p != '\n' && *p != '\0') p++; if (*p == ' ' || *p == '\n' || *p == '\0') { - PMI2U_printf("PMI2U_parse_keyvals: unexpected key delimiter at character %ld in %s", p - st, st); + PMI2U_printf("PMI2U_parse_keyvals: unexpected key delimiter at character %ld in %s", + (long int) (p - st), st); return (-1); } /* Null terminate the key */ diff --git a/contribs/pmi2/pmi2_util.h b/contribs/pmi2/pmi2_util.h index 3a0056d408a..714c23bee20 100644 --- a/contribs/pmi2/pmi2_util.h +++ b/contribs/pmi2/pmi2_util.h @@ -72,7 +72,7 @@ #define PMI2U_CHKMEM_SETERR(rc_, nbytes_, name_) do { \ PMI2U_printf("ERROR: memory allocation of %lu bytes failed for %s", \ - (size_t)nbytes_, name_); \ + (long unsigned int) nbytes_, name_); \ rc_ = PMI2_ERR_NOMEM; \ goto fn_exit; \ } while(0) -- GitLab