We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sum_string_vector
I believe there is a possible UB in the sum_string_vector function (CLI11/include/CLI/TypeTools.hpp:1630), in the 1652-1658 lines:
CLI11/include/CLI/TypeTools.hpp:1630
if(val <= static_cast<double>((std::numeric_limits<std::int64_t>::min)()) || val >= static_cast<double>((std::numeric_limits<std::int64_t>::max)()) || std::ceil(val) == std::floor(val)) { output = detail::value_string(static_cast<int64_t>(val)); } else { output = detail::value_string(val); }
the val gets casted to the std::int64_t if it is less than min or greater than max value.
val
std::int64_t
The text was updated successfully, but these errors were encountered:
Fix possible UB in the sum_string_vector function (TypeTools.hpp) (#893)
dce7983
Fixes #892 Undefined behavior in comparison of doubles.
Successfully merging a pull request may close this issue.
I believe there is a possible UB in the
sum_string_vector
function (CLI11/include/CLI/TypeTools.hpp:1630
), in the 1652-1658 lines:the
val
gets casted to thestd::int64_t
if it is less than min or greater than max value.The text was updated successfully, but these errors were encountered: