rts: fix format arguments for debugBelch calls on 32-bit systems
ClosedPublic

Authored by trofi on Apr 18 2018, 2:20 PM.

Details

Summary

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

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
trofi created this revision.Apr 18 2018, 2:20 PM
trofi requested review of this revision.Apr 18 2018, 4:27 PM
simonmar accepted this revision.Apr 19 2018, 3:05 AM

Thanks!

This revision is now accepted and ready to land.Apr 19 2018, 3:05 AM
This revision was automatically updated to reflect the committed changes.