Skip to content

Commit 5bc9d9d

Browse files
committed
patcher/linux: fix compiler warnings
Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 1147fb3 commit 5bc9d9d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

opal/mca/patcher/linux/patcher_linux_module.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,13 @@ mca_patcher_linux_get_phdr_dynamic(const ElfW(Phdr) *phdr, uint16_t phnum, int p
9090
return NULL;
9191
}
9292

93+
#if SIZEOF_VOID_P == 8
94+
static const ElfW(Dyn)*
95+
mca_patcher_linux_get_dynentry(ElfW(Addr) base, const ElfW(Phdr) *pdyn, int64_t type)
96+
#else
9397
static const ElfW(Dyn)*
94-
mca_patcher_linux_get_dynentry(ElfW(Addr) base, const ElfW(Phdr) *pdyn, uint32_t type)
98+
mca_patcher_linux_get_dynentry(ElfW(Addr) base, const ElfW(Phdr) *pdyn, int32_t type)
99+
#endif
95100
{
96101
for (ElfW(Dyn) *dyn = (ElfW(Dyn)*)(base + pdyn->p_vaddr); dyn->d_tag; ++dyn) {
97102
if (dyn->d_tag == type) {
@@ -196,7 +201,7 @@ static int mca_patcher_linux_get_aux_phent (void)
196201
nread = read(fd, buffer, sizeof(buffer));
197202
if (nread < 0) {
198203
opal_output_verbose (MCA_BASE_VERBOSE_ERROR, opal_patcher_base_framework.framework_output,
199-
"failed to read %lu bytes from %s (ret=%ld): %s", sizeof (buffer),
204+
"failed to read %" PRIsize_t " bytes from %s (ret=%ld): %s", sizeof (buffer),
200205
proc_auxv_filename, nread, strerror (errno));
201206
break;
202207
}
@@ -319,7 +324,8 @@ static int mca_patcher_linux_apply_patch (mca_patcher_linux_patch_t *patch)
319324
(void)dl_iterate_phdr(mca_patcher_linux_phdr_iterator, &ctx);
320325
if (ctx.status == OPAL_SUCCESS) {
321326
opal_output_verbose (MCA_BASE_VERBOSE_INFO, opal_patcher_base_framework.framework_output,
322-
"modified '%s' to 0x%lx", ctx.patch->super.patch_symbol, ctx.patch->super.patch_value);
327+
"modified '%s' to %" PRIxPTR , ctx.patch->super.patch_symbol,
328+
ctx.patch->super.patch_value);
323329
}
324330

325331
return ctx.status;

0 commit comments

Comments
 (0)