summaryrefslogtreecommitdiff
path: root/rts/sm/Sanity.c
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2018-04-19 11:28:46 -0400
committerBen Gamari <ben@smart-cactus.org>2018-04-19 11:28:53 -0400
commit48b88421995b121b62d5b6a1890e61252d49ce90 (patch)
treee14710d8e3c0725fc81fc6c3ab13fd6e7cb31269 /rts/sm/Sanity.c
parent803178a5383cdb5383e5b9fedd8feb3d65f9183b (diff)
downloadhaskell-48b88421995b121b62d5b6a1890e61252d49ce90.tar.gz
rts: fix format arguments for debugBelch calls on 32-bit systems
This change fixes build failure like this: ``` rts/Stats.c:1467:14: error: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Werror=format=] debugBelch("%51s%9" FMT_Word " %9" FMT_Word "\n", ^~~~~~~~ "",tot_live*sizeof(W_),tot_slop*sizeof(W_)); ~~~~~~~~~~~~~~~~~~~ ``` The fix is to cast sizeof() result to Word (W_). Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: build for 32-bit target Reviewers: bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4608
Diffstat (limited to 'rts/sm/Sanity.c')
-rw-r--r--rts/sm/Sanity.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c
index 53b101024a..7a0ad1672f 100644
--- a/rts/sm/Sanity.c
+++ b/rts/sm/Sanity.c
@@ -859,7 +859,7 @@ void findSlop(bdescr *bd)
slop = (bd->blocks * BLOCK_SIZE_W) - (bd->free - bd->start);
if (slop > (1024/sizeof(W_))) {
debugBelch("block at %p (bdescr %p) has %" FMT_Word "KB slop\n",
- bd->start, bd, slop / (1024/sizeof(W_)));
+ bd->start, bd, slop / (1024/(W_)sizeof(W_)));
}
}
}