summaryrefslogtreecommitdiff
path: root/rts/Printer.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/Printer.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/Printer.c')
-rw-r--r--rts/Printer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/Printer.c b/rts/Printer.c
index 702e490b65..87a2cb1927 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -409,7 +409,7 @@ printClosure( const StgClosure *obj )
case COMPACT_NFDATA:
debugBelch("COMPACT_NFDATA(size=%" FMT_Word ")\n",
- (W_)((StgCompactNFData *)obj)->totalW * sizeof(W_));
+ (W_)((StgCompactNFData *)obj)->totalW * (W_)sizeof(W_));
break;