ICU-21579 Fix warnings in number formatting code

This commit is contained in:
Shane F. Carr 2021-10-27 15:02:46 -07:00
parent a061dfea1f
commit a56dde820d
2 changed files with 5 additions and 1 deletions

View file

@ -209,6 +209,8 @@ ufmtval_getString(
if (pLength != nullptr) {
*pLength = readOnlyAlias.length();
}
// Note: this line triggers -Wreturn-local-addr, but it is safe because toTempString is
// defined to return memory owned by the ufmtval argument.
return readOnlyAlias.getBuffer();
}

View file

@ -1358,7 +1358,9 @@ bool blueprint_helpers::parseFracSigOption(const StringSegment& segment, MacroPr
priority = UNUM_ROUNDING_PRIORITY_STRICT;
offset++;
} else {
U_ASSERT(offset < segment.length());
// Invalid digits option for fraction rounder
status = U_NUMBER_SKELETON_SYNTAX_ERROR;
return false;
}
if (offset < segment.length()) {
// Invalid digits option for fraction rounder