mirror of
https://github.com/CLIUtils/CLI11.git
synced 2026-01-19 04:52:08 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user