Fix warnings and small issues (#1178)

try some things with no standard libraries
Add arm64 and freebsd build and tests
fix a discrepancy in the handling of chars on Arm processors

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Philip Top
2025-07-18 07:18:26 -07:00
committed by GitHub
parent 587129a170
commit c5153634db
10 changed files with 117 additions and 30 deletions

View File

@@ -165,7 +165,7 @@ CLI11_INLINE bool valid_name_string(const std::string &str);
/// Verify an app name
inline bool valid_alias_name_string(const std::string &str) {
static const std::string badChars(std::string("\n") + '\0');
static const std::string badChars{'\n', '\0'};
return (str.find_first_of(badChars) == std::string::npos);
}

View File

@@ -1130,7 +1130,14 @@ bool lexical_cast(const std::string &input, T &output) {
output = static_cast<T>(input[0]);
return true;
}
return integral_conversion(input, output);
std::int8_t res{0};
// we do it this way as some systems have char as signed and not, this ensures consistency in the way things are
// handled
bool result = integral_conversion(input, res);
if(result) {
output = static_cast<T>(res);
}
return result;
}
/// Boolean values