diff options
author | bollu <siddu.druid@gmail.com> | 2017-02-14 08:43:58 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-02-14 10:53:01 -0500 |
commit | 60c49861465015659a25542692b6d259667759e5 (patch) | |
tree | ff2e3d7a495bf93bef6c5a91bc8cdb14d2ce8515 | |
parent | 2d6e91eab9391210b8b816d9664407f246ef30e4 (diff) | |
download | haskell-60c49861465015659a25542692b6d259667759e5.tar.gz |
Typecast covers entire expression to fix format warning.
- Fixes (#12636).
- changes all the typecasts to _unsinged long long_ to
have the format specifiers work.
Reviewers: austin, bgamari, erikd, simonmar, Phyx
Reviewed By: erikd, Phyx
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D3129
-rw-r--r-- | rts/ProfHeap.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index d492b89b03..608b976605 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -770,17 +770,22 @@ dumpCensus( Census *census ) traceHeapProfSampleBegin(era); #ifdef PROFILING + /* change typecast to uint64_t to remove + * print formatting warning. See #12636 */ if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) { - fprintf(hp_file, "VOID\t%lu\n", - (unsigned long)(census->void_total) * sizeof(W_)); - fprintf(hp_file, "LAG\t%lu\n", - (unsigned long)(census->not_used - census->void_total) * sizeof(W_)); - fprintf(hp_file, "USE\t%lu\n", - (unsigned long)(census->used - census->drag_total) * sizeof(W_)); - fprintf(hp_file, "INHERENT_USE\t%lu\n", - (unsigned long)(census->prim) * sizeof(W_)); - fprintf(hp_file, "DRAG\t%lu\n", - (unsigned long)(census->drag_total) * sizeof(W_)); + fprintf(hp_file, "VOID\t%" FMT_Word64 "\n", + (uint64_t)(census->void_total * + sizeof(W_))); + fprintf(hp_file, "LAG\t%" FMT_Word64 "\n", + (uint64_t)((census->not_used - census->void_total) * + sizeof(W_))); + fprintf(hp_file, "USE\t%" FMT_Word64 "\n", + (uint64_t)((census->used - census->drag_total) * + sizeof(W_))); + fprintf(hp_file, "INHERENT_USE\t%" FMT_Word64 "\n", + (uint64_t)(census->prim * sizeof(W_))); + fprintf(hp_file, "DRAG\t%" FMT_Word64 "\n", + (uint64_t)(census->drag_total * sizeof(W_))); printSample(false, census->time); return; } |