Skip to content

Commit e089910

Browse files
dbortfacebook-github-bot
authored andcommitted
Fix some printf warnings in executor_runner.cpp (#1529)
Summary: Pull Request resolved: #1529 Some compilers don't like passing enums as printf arguments without casting them first. Reviewed By: larryliu0820 Differential Revision: D52528480 fbshipit-source-id: 8d572995ac4bbc52077d1e955b5b361168a8ec53
1 parent 4a545ce commit e089910

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/portable/executor_runner/executor_runner.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ int main(int argc, char** argv) {
5959
const char* model_path = FLAGS_model_path.c_str();
6060
Result<FileDataLoader> loader = FileDataLoader::from(model_path);
6161
ET_CHECK_MSG(
62-
loader.ok(), "FileDataLoader::from() failed: 0x%" PRIx32, loader.error());
62+
loader.ok(),
63+
"FileDataLoader::from() failed: 0x%" PRIx32,
64+
(uint32_t)loader.error());
6365

6466
// Parse the program file. This is immutable, and can also be reused between
6567
// multiple execution invocations across multiple threads.
@@ -83,9 +85,9 @@ int main(int argc, char** argv) {
8385
Result<MethodMeta> method_meta = program->method_meta(method_name);
8486
ET_CHECK_MSG(
8587
method_meta.ok(),
86-
"Failed to get method_meta for %s: 0x%x",
88+
"Failed to get method_meta for %s: 0x%" PRIx32,
8789
method_name,
88-
(unsigned int)method_meta.error());
90+
(uint32_t)method_meta.error());
8991

9092
//
9193
// The runtime does not use malloc/new; it allocates all memory using the
@@ -146,7 +148,7 @@ int main(int argc, char** argv) {
146148
method.ok(),
147149
"Loading of method %s failed with status 0x%" PRIx32,
148150
method_name,
149-
method.error());
151+
(uint32_t)method.error());
150152
ET_LOG(Info, "Method loaded.");
151153

152154
// Prepare the inputs.
@@ -160,7 +162,7 @@ int main(int argc, char** argv) {
160162
status == Error::Ok,
161163
"Execution of method %s failed with status 0x%" PRIx32,
162164
method_name,
163-
status);
165+
(uint32_t)status);
164166
ET_LOG(Info, "Model executed successfully.");
165167

166168
// Print the outputs.

0 commit comments

Comments
 (0)