the OPT_U32 options was translated using strict_si_cast<int>(), and then
cast the converted result to uint32_t. this could cause integer
underflow. we could have lifted the burden of checking invalid input
from the user of this option to the strict_si_cast<>() function. so in
this change, we use strict_si_cast<uint32_t>() instead, before casting
the converted value into `uint32_t`.
Signed-off-by: Kefu Chai <firstname.lastname@example.org>
(cherry picked from commit b7babd6)
this fixes the build on armf.
on 32bit platforms, cstdint is very likely to
typedef long long int int64_t;
this results in compilation error like
`common/strtol.cc:190:75: error: duplicate explicit instantiation of 'T
strict_si_cast(const char, std::string) [with T = long long int;
std::string = std::basic_string]'
template int64_t strict_si_cast(const char *str, std::string *err);
we can address this by instantiate the primitive type of `long long`
instead of `in64_t`.
Signed-off-by: Kefu Chai <email@example.com>
(cherry picked from commit 31db4c5)
All checks have failed
2 failing checks
— one or more commits in this PR are not signed