From d28c2a857e248e67f8cb32ac37feb56db9d71c9c Mon Sep 17 00:00:00 2001 From: David Eklov Date: Wed, 7 Sep 2022 11:15:20 -0700 Subject: [PATCH] Ignore return value of function declared with 'warn_unused_result' (#84369) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/84369 X-link: https://github.com/pytorch/multipy/pull/152 Ignore return value of function declared with 'warn_unused_result' Addresses the following build failure that we get on some of our internal build environments: caffe2/torch/csrc/deploy/environment.h:60:5: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] system(rmCmd.c_str()); Test Plan: Successful build Reviewed By: jiyuanzFB, PaliC Differential Revision: D39181069 fbshipit-source-id: e571b09c6da9ca3dcac2b5eaf9f8a3f8473adefd --- torch/csrc/deploy/environment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch/csrc/deploy/environment.h b/torch/csrc/deploy/environment.h index 433ce6bcb3f66..5837b59a1b3b8 100644 --- a/torch/csrc/deploy/environment.h +++ b/torch/csrc/deploy/environment.h @@ -57,7 +57,7 @@ class Environment { } virtual ~Environment() { auto rmCmd = fmt::format("rm -rf {}", extraPythonLibrariesDir_); - system(rmCmd.c_str()); + (void)system(rmCmd.c_str()); } virtual void configureInterpreter(Interpreter* interp) = 0; virtual const std::vector& getExtraPythonPaths() {