This is an archive of the discontinued LLVM Phabricator instance.

Fix build warning for uint64_t
AbandonedPublic

Authored by Lewuathe on Oct 6 2020, 10:04 PM.

Details

Summary

A format specifier used in SparkUtils causes the warning which formats uint64_t with %lu. We can use %llu instead of uint64_T.

SparseUtils.cpp:169:36: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
  sprintf(var, "SPARSE_MATRIX%lu", id);
                             ~~~   ^~
                             %llu

Diff Detail

Event Timeline

Lewuathe created this revision.Oct 6 2020, 10:04 PM
Lewuathe requested review of this revision.Oct 6 2020, 10:04 PM

The pre-merge differs here - if you want to appease both you'd probably need to use PRIu64 (https://en.cppreference.com/w/c/types/integer) it seems

ftynse added a subscriber: ftynse.Oct 7 2020, 8:59 AM
ftynse added inline comments.
mlir/lib/ExecutionEngine/SparseUtils.cpp
169

Yes please use PRIu64 as I did above. I actually had noticed this omission, but was too late.
Sorry for the lint breakage.

Note that this has been fixed as part of D89005, which also changes the name of this method for consistency.

Lewuathe abandoned this revision.Oct 7 2020, 4:16 PM