From 4862ba55c3844760b793707e3d1ea7ca751905c8 Mon Sep 17 00:00:00 2001 From: Veselin Petrov Date: Wed, 30 Oct 2024 14:11:20 -0700 Subject: [PATCH] Executorch ops fail to build on macbook M1 due to bad formatting Summary: ``` .... executorch/kernels/quantized/cpu/embeddingxb.cpp:140:11: error: format specifies type 'char' but the argument has type 'int32_t' (aka 'int') [-Werror,-Wformat] i, ^~ executorch/runtime/platform/assert.h:39:59: note: expanded from macro 'ET_CHECK_MSG' ET_ASSERT_MESSAGE_EMIT(" (%s): " _format, #_cond, ##__VA_ARGS__); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ executorch/runtime/platform/assert.h:26:9: note: expanded from macro 'ET_ASSERT_MESSAGE_EMIT' ##__VA_ARGS__) ~~^~~~~~~~~~~~ executorch/runtime/platform/log.h:172:13: note: expanded from macro 'ET_LOG' ##__VA_ARGS__); \ ^~~~~~~~~~~ 1 warning and 1 error generated. ``` Reviewed By: dongpujin, manuelcandales Differential Revision: D65156573 --- kernels/quantized/cpu/embeddingxb.cpp | 2 +- kernels/quantized/cpu/op_embedding.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernels/quantized/cpu/embeddingxb.cpp b/kernels/quantized/cpu/embeddingxb.cpp index 2b149646e8c..f8fdfe078c5 100644 --- a/kernels/quantized/cpu/embeddingxb.cpp +++ b/kernels/quantized/cpu/embeddingxb.cpp @@ -134,7 +134,7 @@ void check_embedding_xbit_args( for (int32_t i = 0; i < weight_scales.dim(); ++i) { ET_CHECK_MSG( opt_weight_zero_points.value().size(i) == weight_scales.size(i), - "Dimension size misatch at dim %" PRId8 + "Dimension size misatch at dim %" PRIi32 "Weight_zero_point size = %zd" ", weight_scales size = %zd.", i, diff --git a/kernels/quantized/cpu/op_embedding.cpp b/kernels/quantized/cpu/op_embedding.cpp index dda1d6027d9..e48e9a7eea8 100644 --- a/kernels/quantized/cpu/op_embedding.cpp +++ b/kernels/quantized/cpu/op_embedding.cpp @@ -93,7 +93,7 @@ void check_embedding_byte_args( for (int32_t i = 0; i < weight_scales.dim(); ++i) { ET_CHECK_MSG( opt_weight_zero_points.value().size(i) == weight_scales.size(i), - "Dimension size misatch at dim %" PRId8 + "Dimension size misatch at dim %" PRIi32 "Weight_zero_point size = %zd" ", weight_scales size = %zd.", i,