From 9457b3de3a9906db78b2a14e71da4dbdc39cfdbd Mon Sep 17 00:00:00 2001 From: Florin Iucha Date: Wed, 27 Nov 2019 16:30:23 -0500 Subject: [PATCH] Fix -Wconversion warnings with GCC9 (#214) --- include/cxxopts.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index e89c2e1..93c69d3 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -551,7 +551,7 @@ namespace cxxopts // if we got to here, then `t` is a positive number that fits into // `R`. So to avoid MSVC C4146, we first cast it to `R`. // See https://github.com/jarro2783/cxxopts/issues/62 for more details. - return -static_cast(t-1)-1; + return static_cast(-static_cast(t-1)-1); } template @@ -611,7 +611,7 @@ namespace cxxopts throw_or_mimic(text); } - US next = result * base + digit; + const US next = static_cast(result * base + digit); if (result > next) { throw_or_mimic(text); -- libgit2 0.21.4