From 3b6306adaa9acf9ce7297129eb2215823de5b70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Guerrero=20L=C3=B3pez?= Date: Fri, 29 Jul 2016 23:50:47 +0200 Subject: [PATCH 1/2] Fix the following errors when building with GCC 6: psm_diags.c: In function 'memcpy_check_size': psm_diags.c:286:7: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation] if (dst) psmi_free(dst); ^~ psm_diags.c:284:5: note: ...this 'if' clause, but it is not if (src == NULL || dst == NULL) ^~ --- psm_diags.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/psm_diags.c b/psm_diags.c index 3e2df9d..4502cf1 100644 --- a/psm_diags.c +++ b/psm_diags.c @@ -281,10 +281,11 @@ memcpy_check_size (memcpy_fn_t fn, int *p, int *f, size_t n) if (USE_MALLOC) { src = psmi_malloc(PSMI_EP_NONE, UNDEFINED, size); dst = psmi_malloc(PSMI_EP_NONE, UNDEFINED, size); - if (src == NULL || dst == NULL) + if (src == NULL || dst == NULL) { if (src) psmi_free(src); if (dst) psmi_free(dst); return -1; + } } else { void *src_p = NULL, *dst_p = NULL; From 87aa2f5846366ebd4dec296c93eea3e1d017a482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Guerrero=20L=C3=B3pez?= Date: Fri, 29 Jul 2016 23:52:23 +0200 Subject: [PATCH 2/2] Fix the following problems when building with GCC 6 on i386: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from /«BUILDDIR»/psm/include/ipath_user.h:63:0, from /«BUILDDIR»/psm/psm_user.h:45, from am_reqrep_shmem.c:40: am_reqrep_shmem.c: In function 'psmi_shm_attach': /«BUILDDIR»/psm/include/ipath_udebug.h:79:28: error: format '%ld' expects argument of type 'long int', but argument 6 has type 'size_t {aka unsigned int}' [-Werror=format=] fprintf(__ipath_dbgout, "%s%s: " fmt, __ipath_mylabel, __func__, \ ^ /«BUILDDIR»/psm/include/ipath_udebug.h:95:31: note: in expansion of macro '__IPATH_DBG_WHICH' #define _IPATH_PRDBG(fmt,...) __IPATH_DBG_WHICH(__IPATH_PROCDBG,fmt,##__VA_ARGS__) ^ am_reqrep_shmem.c:544:2: note: in expansion of macro '_IPATH_PRDBG' _IPATH_PRDBG("Mapped and initialized shm object control page at %p," ^ --- ptl_am/am_reqrep_shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ptl_am/am_reqrep_shmem.c b/ptl_am/am_reqrep_shmem.c index 909ca9e..50d86f4 100644 --- a/ptl_am/am_reqrep_shmem.c +++ b/ptl_am/am_reqrep_shmem.c @@ -542,7 +542,7 @@ psmi_shm_attach(psm_ep_t ep, int *shmidx_o) ep->amsh_dirpage->is_init = 1; _IPATH_PRDBG("Mapped and initialized shm object control page at %p," - "size=%ld, kcopy minor is %d (mode=%s)\n", mapptr, + "size=%zu, kcopy minor is %d (mode=%s)\n", mapptr, segsz, kcopy_minor, psmi_kassist_getmode(ep->psmi_kassist_mode)); }