diff options
author | Kane York <kanepyork@gmail.com> | 2020-11-27T01·25-0800 |
---|---|---|
committer | kanepyork <rikingcoding@gmail.com> | 2020-11-27T18·34+0000 |
commit | 5fb58e23deb28e2060500d347d402c2f48386691 (patch) | |
tree | 2734cdc316bb8ff37bb331512a645be97109355e /third_party/nix/src/libmain/shared.cc | |
parent | 35bd980bd12393e3cf3796d2d6b435cd0d0ab189 (diff) |
fix(tvix): make unsigned conversion explicit r/1930
Implicit signedness conversion was causing warnings. Perform a static_cast; this value should never be out of range. third_party/nix/src/libmain/shared.cc:310:12: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions] Change-Id: I34fe53d186ae33f970147135bbe3894fb39a0ec7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2156 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'third_party/nix/src/libmain/shared.cc')
-rw-r--r-- | third_party/nix/src/libmain/shared.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/third_party/nix/src/libmain/shared.cc b/third_party/nix/src/libmain/shared.cc index cd4b7879fd21..331ea6b3a9d2 100644 --- a/third_party/nix/src/libmain/shared.cc +++ b/third_party/nix/src/libmain/shared.cc @@ -307,7 +307,7 @@ int handleExceptions(const std::string& programName, if (!e.prefix().empty() && !settings.showTrace) { LOG(INFO) << "(use '--show-trace' to show detailed location information)"; } - return e.status; + return static_cast<int>(e.status); } catch (std::bad_alloc& e) { LOG(ERROR) << error << "failed to allocate: " << e.what(); return 1; |