Commit 60c49861 authored by Siddharth's avatar Siddharth Committed by Ben Gamari
Browse files

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
parent 2d6e91ea
...@@ -770,17 +770,22 @@ dumpCensus( Census *census ) ...@@ -770,17 +770,22 @@ dumpCensus( Census *census )
traceHeapProfSampleBegin(era); traceHeapProfSampleBegin(era);
#ifdef PROFILING #ifdef PROFILING
/* change typecast to uint64_t to remove
* print formatting warning. See #12636 */
if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) { if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV) {
fprintf(hp_file, "VOID\t%lu\n", fprintf(hp_file, "VOID\t%" FMT_Word64 "\n",
(unsigned long)(census->void_total) * sizeof(W_)); (uint64_t)(census->void_total *
fprintf(hp_file, "LAG\t%lu\n", sizeof(W_)));
(unsigned long)(census->not_used - census->void_total) * sizeof(W_)); fprintf(hp_file, "LAG\t%" FMT_Word64 "\n",
fprintf(hp_file, "USE\t%lu\n", (uint64_t)((census->not_used - census->void_total) *
(unsigned long)(census->used - census->drag_total) * sizeof(W_)); sizeof(W_)));
fprintf(hp_file, "INHERENT_USE\t%lu\n", fprintf(hp_file, "USE\t%" FMT_Word64 "\n",
(unsigned long)(census->prim) * sizeof(W_)); (uint64_t)((census->used - census->drag_total) *
fprintf(hp_file, "DRAG\t%lu\n", sizeof(W_)));
(unsigned long)(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); printSample(false, census->time);
return; return;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment