This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] locale: Avoid warning in --verbose mode for non-symbolic character.
- From: Carlos O'Donell <carlos at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>, Mike Fabian <mfabian at redhat dot com>
- Cc: Zack Weinberg <zackw at panix dot com>
- Date: Fri, 13 Oct 2017 12:34:28 -0700
- Subject: [PATCH] locale: Avoid warning in --verbose mode for non-symbolic character.
- Authentication-results: sourceware.org; auth=none
Mike,
I'm working through a new C.UTF-8 locale and I need this fix to avoid
warnings in --verbose mode.
~~~ commit msg:
locale: Avoid warning in --verbose mode for non-symbolic character.
In "Is it OK to write ASCII strings directly into locale source files?"
https://sourceware.org/ml/libc-alpha/2017-07/msg00807.html
there is universal consensus that we do not have to keep writing <Uxxxx>
symbolic characters in locale files.
Ulrich Drepper's historical comment was that symbolic characters were
used for the eventuality of converting the source files to any encoding
system. Fast forward to today and UTF-8 is the standard. So the requirement
of <Uxxxx> is hard to justify.
Zack Weinberg's excellent scripts are coming along we can use these to find
instances of human errors in the scripts:
https://sourceware.org/ml/libc-alpha/2017-07/msg00860.html
https://sourceware.org/ml/libc-alpha/2017-08/msg00136.html
It still won't be easy to distinguish from i for í, but that's still the
case for <Uxxxx> characters which humans can't read either.
Since we all agreed that we should be able to use non-symbolic (<Uxxxx>)
characters in locale files, the following change removes the verbose
warning that is raised if you use non-symbolic characters in the locale
file.
Signed-off-by: Carlos O'Donell <carlos@redhat.com>
~~~
Tested by building all locales and showing no warnings.
Tested with my C.UTF-8 which issued warnings before and now it doesn't
both when using --verbose.
OK to checkin?
2017-10-13 Carlos O'Donell <carlos@redhat.com>
* locale/programs/linereader.c (get_string): Don't warn on
non-symbolic character.
diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
index 52b3409..02fb476 100644
--- a/locale/programs/linereader.c
+++ b/locale/programs/linereader.c
@@ -634,7 +634,6 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
size_t buf2act = 0;
size_t buf2max = 56 * sizeof (uint32_t);
int ch;
- int warned = 0;
/* We have to provide the wide character result as well. */
if (return_widestr)
@@ -664,13 +663,6 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
break;
}
- if (verbose && !warned)
- {
- lr_error (lr, _("\
-non-symbolic character value should not be used"));
- warned = 1;
- }
-
ADDC (ch);
if (return_widestr)
ADDWC ((uint32_t) ch);
---
--
Cheers,
Carlos.