Skip to content

Mac M1 CMake build failure: "variable 'i' set but not used" error in third-party/flatbuffers/src/idl_gen_rust.cpp #37

Closed
@dbort

Description

When building with CMake at 77175d7 on an M1 mac

(executorch) executorch % cmake --build cmake-out -j33

...

[ 17%] Building CXX object third-party/flatbuffers/CMakeFiles/flatc.dir/grpc/src/compiler/swift_generator.cc.o
/Users/@@@@@@@/executorch/third-party/flatbuffers/src/idl_gen_rust.cpp:397:12: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
    size_t i = 0;
           ^
[ 17%] Linking CXX static library libgflags_nothreads.a
[ 17%] Built target gflags_nothreads_static
1 error generated.
make[2]: *** [third-party/flatbuffers/CMakeFiles/flatc.dir/src/idl_gen_rust.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [third-party/flatbuffers/CMakeFiles/flatc.dir/all] Error 2
make: *** [all] Error 2

Compiler info

% c++ --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.6.0
Thread model: posix

Reported by @mergennachin

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions