From 0e62580a4a8e1f8ee757215217cb692854515b88 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 25 Feb 2003 01:58:57 +0000 Subject: [PATCH] ICU-2593 Just make sure that the aliases don't have options because they aren't needed. There isn't a need to verify the converter name because we may want to unlist a converter without an option. X-SVN-Rev: 11148 --- icu4c/source/tools/gencnval/gencnval.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/icu4c/source/tools/gencnval/gencnval.c b/icu4c/source/tools/gencnval/gencnval.c index 2f479d04d3..710fa85055 100644 --- a/icu4c/source/tools/gencnval/gencnval.c +++ b/icu4c/source/tools/gencnval/gencnval.c @@ -622,7 +622,7 @@ addToKnownAliases(const char *alias) { } /* -@param When standard is 0, then it's the default tag. +@param standard When standard is 0, then it's the "empty" tag. */ static uint16_t addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool defaultName) { @@ -652,6 +652,23 @@ addAlias(const char *alias, uint16_t standard, uint16_t converter, UBool default exit(U_BUFFER_OVERFLOW_ERROR); } + /* Show this warning only once. All aliases are added to the "ALL" tag. */ + if (standard == ALL_TAG_NUM && GET_ALIAS_STR(converters[converter].converter) != alias) { + /* Normally these option values are parsed at runtime, and they can + be discarded when the alias is a default converter. Options should + only be on a converter and not an alias. */ + if (uprv_strchr(alias, UCNV_OPTION_SEP_CHAR) != 0) + { + fprintf(stderr, "warning(line %d): alias %s contains a \""UCNV_OPTION_SEP_STRING"\". Options are parsed at run-time and do not need to be in the alias table.\n", + lineNum, alias); + } + if (uprv_strchr(alias, UCNV_VALUE_SEP_CHAR) != 0) + { + fprintf(stderr, "warning(line %d): alias %s contains an \""UCNV_VALUE_SEP_STRING"\". Options are parsed at run-time and do not need to be in the alias table.\n", + lineNum, alias); + } + } + /* Check for duplicates in a tag/converter combination */ for (idx = 0; idx < aliasList->aliasCount; idx++) { uint16_t aliasNum = tags[standard].aliasList[converter].aliases[idx];