mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: One of our builds fails because the return value of fread is discarded. Explicit cast to void fixes the build. ```log In file included from fbcode/caffe2/torch/csrc/jit/mobile/import.cpp:15: fbcode/caffe2/torch/csrc/jit/mobile/file_format.h:156:3: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] 156 | fread(data.get(), size, 1, f); | ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ... BUILD FAILED Failed to build 'fbcode//caffe2:libtorch (cfg:opt-linux-x86_64-clang19-no-san-opt-by-default#fef256f7ee896871)' ``` Test Plan: No runtime behavior change. CI. Rollback Plan: Differential Revision: D82265002 Pull Request resolved: https://github.com/pytorch/pytorch/pull/162767 Approved by: https://github.com/Skylion007