This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: binutils + i18n
- To: "H . J . Lu" <hjl at lucon dot org>
- Subject: Re: PATCH: binutils + i18n
- From: Bruno Haible <haible at ilog dot fr>
- Date: Thu, 20 Sep 2001 17:57:06 +0200 (CEST)
- Cc: binutils at sourceware dot cygnus dot com
- References: <20010918223923.A20929@lucon.org><20010919115352.A1167@lucon.org>
H . J . Lu writes:
> There are still a few "#include <ctype.h>" left:
>
> ./include/mpw/mpw.h:#include <ctype.h>
This code doesn't appear to be included by any of the real binutils files.
> ./bfd/doc/chew.c:#include <ctype.h>
This is a standalone program which doesn't use gettext and can therefore
continue to use <ctype.h>.
> ./opcodes/arc-dis.c:#include <ctype.h>
> ./opcodes/openrisc-desc.c:#include <ctype.h>
> ./opcodes/openrisc-ibld.c:#include <ctype.h>
> ./gas/config/tc-openrisc.c:#include <ctype.h>
Please find below a patch for these.
> ./intl/finddomain.c:#include <ctype.h>
> ./intl/l10nflist.c:#include <ctype.h>
> ./intl/localealias.c:#include <ctype.h>
These deal really with internationalizable strings. No need to change them.
> ./libiberty/regex.c:# include <wctype.h>
> ./libiberty/regex.c:# include <ctype.h>
grep 're[_g]\(comp\|exec\)' shows that these LC_CTYPE dependent functions
are indeed used, in
opcodes/fr30-asm.c
opcodes/m32r-asm.c
opcodes/m32r-asm.c
But the regular expressions are all of the form "fixedpart.*fixedpart[ \t]*$".
(See m32r_cgen_build_insn_regex et al.) Therefore its i18n dependency is
reduced to the locale dependent case comparison. Which means that the only
problem is that in a turkish locale,
1. 'i' and 'I' won't be recognized as equivalent
2. that the 'i without dot' and 'I with dot above' characters would become
valid in assembler source.
(2) is not important, but (1) is critical, because it means that some
assembler source which compiles in most locales of the world will not pass
in turkish locale. I will work on a patch for this.
Bruno
===================================================================
Here is the first additional patch.
gas/ChangeLog:
2001-09-19 Bruno Haible <haible@clisp.cons.org>
* config/tc-openrisc.c: Don't include <ctype.h>.
opcodes/ChangeLog:
2001-09-19 Bruno Haible <haible@clisp.cons.org>
* arc-dis.c: Don't include <ctype.h>.
* openrisc-desc.c: Likewise.
* openrisc-ibld.c: Likewise.
*** gas/config/tc-openrisc.c.bak Thu May 10 13:32:52 2001
--- gas/config/tc-openrisc.c Thu Sep 20 03:17:43 2001
***************
*** 20,26 ****
Boston, MA 02111-1307, USA. */
#include <stdio.h>
- #include <ctype.h>
#include "as.h"
#include "subsegs.h"
#include "symcat.h"
--- 20,25 ----
*** opcodes/arc-dis.c.bak Thu Sep 20 03:20:28 2001
--- opcodes/arc-dis.c Thu Sep 20 03:20:47 2001
***************
*** 26,32 ****
#include <string.h>
#include "opintl.h"
- #include <ctype.h>
#include <stdarg.h>
#include "arc-dis.h"
#include "arc-ext.h"
--- 26,31 ----
*** opcodes/openrisc-desc.c.bak Sun Aug 12 22:16:29 2001
--- opcodes/openrisc-desc.c Thu Sep 20 03:23:55 2001
***************
*** 23,29 ****
*/
#include "sysdep.h"
- #include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include "ansidecl.h"
--- 23,28 ----
*** opcodes/openrisc-ibld.c.bak Sun Aug 12 22:16:29 2001
--- opcodes/openrisc-ibld.c Thu Sep 20 03:23:55 2001
***************
*** 25,31 ****
Keep that in mind. */
#include "sysdep.h"
- #include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "dis-asm.h"
--- 25,30 ----