Skip to content

Fix -Wformat with Clang 17 #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions runtime/core/exec_aten/util/scalar_type_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ inline size_t elementSize(exec_aten::ScalarType t) {
switch (t) {
ET_FORALL_SCALAR_TYPES(CASE_ELEMENTSIZE_CASE)
default:
ET_CHECK_MSG(false, "Unknown ScalarType %hhd", t);
ET_CHECK_MSG(false, "Unknown ScalarType %" PRId8, static_cast<int8_t>(t));
}
#undef CASE_ELEMENTSIZE_CASE
}
Expand Down Expand Up @@ -552,8 +552,8 @@ inline size_t sizeof_scalar_type(exec_aten::ScalarType type) {
type != exec_aten::ScalarType::ComplexDouble &&
type != exec_aten::ScalarType::BFloat16 &&
type != exec_aten::ScalarType::Undefined,
"Invalid or unsupported ScalarType %hhd",
type);
"Invalid or unsupported ScalarType %" PRId8,
static_cast<int8_t>(type));

size_t type_size = 0;
#define SCALAR_TYPE_SIZE(ctype, dtype) \
Expand All @@ -564,7 +564,8 @@ inline size_t sizeof_scalar_type(exec_aten::ScalarType type) {
switch (type) {
ET_FORALL_SCALAR_TYPES(SCALAR_TYPE_SIZE)
default:
ET_CHECK_MSG(false, "Invalid input ScalarType %hhd", type);
ET_CHECK_MSG(
false, "Invalid input ScalarType %" PRId8, static_cast<int8_t>(type));
}
#undef SCALAR_TYPE_SIZE

Expand Down