Tell people to use character literals or CHARVAL instead of strings as numbers

This commit is contained in:
Rangi42
2025-09-03 22:46:19 -04:00
parent c5c2800f17
commit c5d437ab3c
6 changed files with 13 additions and 10 deletions

View File

@@ -186,7 +186,10 @@ uint32_t act_CharToNum(std::string const &str) {
}
uint32_t act_StringToNum(std::string const &str) {
warning(WARNING_OBSOLETE, "Treating strings as numbers is deprecated");
warning(
WARNING_OBSOLETE,
"Treating strings as numbers is deprecated; use character literals or `CHARVAL` instead"
);
if (std::vector<int32_t> units = charmap_Convert(str); units.size() == 1) {
// The string is a single character with a single unit value,
// which can be used directly as a number.