Skip to content

Commit c0b539b

Browse files
Jim Meyeringfacebook-github-bot
authored andcommitted
executorch/examples/portable/custom_ops/custom_ops_2_out.cpp: fix llvm-17-exposed format mismatches (#6368)
Summary: This avoids the following errors: executorch/examples/portable/custom_ops/custom_ops_2_out.cpp:23:7: error: format specifies type 'char' but the argument has type 'ScalarType' [-Werror,-Wformat] executorch/examples/portable/custom_ops/custom_ops_2_out.cpp:27:7: error: format specifies type 'char' but the argument has type 'ScalarType' [-Werror,-Wformat] Also, change the format to %d and the cast to match -- perhaps a little more future-safe. Differential Revision: D64656845
1 parent 46ea1a4 commit c0b539b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/portable/custom_ops/custom_ops_2_out.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ namespace {
1919
void check_preconditions(const Tensor& in, Tensor& out) {
2020
ET_CHECK_MSG(
2121
out.scalar_type() == ScalarType::Float,
22-
"Expected out tensor to have dtype Float, but got %hhd instead",
23-
out.scalar_type());
22+
"Expected out tensor to have dtype Float, but got %d instead",
23+
static_cast<int>(out.scalar_type()));
2424
ET_CHECK_MSG(
2525
in.scalar_type() == ScalarType::Float,
26-
"Expected in tensor to have dtype Float, but got %hhd instead",
27-
in.scalar_type());
26+
"Expected in tensor to have dtype Float, but got %d instead",
27+
static_cast<int>(in.scalar_type()));
2828
ET_CHECK_MSG(
2929
out.dim() == in.dim(),
3030
"Number of dims of out tensor is not compatible with inputs");

0 commit comments

Comments
 (0)