This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch installed for gcc and java dir const-ification


 > From: Tom Tromey <tromey@redhat.com>
 > 
 > You have to get the file from the Unicode Consortium.  I believe you
 > should use version 3.0 of the table.  This is what the 1.4 JDK is
 > documented as using -- the situation is actually a bit vague; an
 > argument could be made for other versions of the tables too.
 > 
 > I looked around a bit.  Perhaps 3.0.1 is the current best choice.
 > 
 >     ftp://www.unicode.org/Public/3.0-Update1/UnicodeData-3.0.1.txt
 > 
 > Could you add a comment to gen-table.pl with the above URL at least?
 > That would be helpful for future hackers...


Sure.  But when I ran 3.0.1 through gen-table.pl the output was vastly
different from the old chartables.h.  It had a whole bunch of (char*)0
extra lines and somehow a parsing error got inserted so it wouldn't
compile.  I think the gen-table.pl script encounters some input that
it didn't expect and doesn't yield valid C code.

 > In file included from ../../egcc-CVS20011226/gcc/java/lex.c:39,
 >                  from ../../egcc-CVS20011226/gcc/java/parse.y:457:
 > java/chartables.h:2964: parse error before ',' token
 > java/chartables.h:3224: warning: excess elements in array initializer
 > [...] (many rows)
 > java/chartables.h:7320: warning: excess elements in array initializer


I backed down to 3.0.0 and it worked.  The only diffs to my
hand-tweeked chartable.h were the macro wrapper names that never got
regenerated from the last update made to gen-table.pl.  (I included it
so you could see.)

I think the upgrade to 3.0.1 should be left for the author of
gen-table.pl to work on. ;-)

Okay to install?

		--Kaveh


2001-12-27  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* gen-table.pl: Const-ify output.  Document the location of a
	suitable unicode input file.

	* chartables.h: Regenerate.

diff -rup orig/egcc-CVS20011227/gcc/java/gen-table.pl egcc-CVS20011227/gcc/java/gen-table.pl
--- orig/egcc-CVS20011227/gcc/java/gen-table.pl	Sat May 26 07:30:36 2001
+++ egcc-CVS20011227/gcc/java/gen-table.pl	Thu Dec 27 21:45:15 2001
@@ -19,6 +19,10 @@
 
 # gen-table.pl - Generate tables for gcj from Unicode data.
 # Usage: perl gen-table.pl DATA-FILE
+#
+# A suitable DATA-FILE is available at:
+# ftp://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt
+
 
 # Names of fields in Unicode data table.
 $CODE = 0;
@@ -191,11 +195,11 @@ sub print_tables
 
     for ($count = 0; $count <= $last; $count += 256)
     {
-	$row[$count / 256] = &print_row ($count, '(char *) ', 'char', 1,
+	$row[$count / 256] = &print_row ($count, '(char *) ', 'const char', 1,
 					 'page');
     }
 
-    print OUT "static char *type_table[256] = {\n";
+    print OUT "static const char *const type_table[256] = {\n";
     for ($count = 0; $count <= $last; $count += 256)
     {
 	print OUT ",\n" if $count > 0;
diff -rup orig/egcc-CVS20011227/gcc/java/chartables.h egcc-CVS20011227/gcc/java/chartables.h
--- orig/egcc-CVS20011227/gcc/java/chartables.h	Wed Dec 26 22:31:44 2001
+++ egcc-CVS20011227/gcc/java/chartables.h	Thu Dec 27 21:46:14 2001
@@ -1,8 +1,8 @@
 /* This file is automatically generated.  DO NOT EDIT!
    Instead, edit gen-table.pl and re-run.  */
 
-#ifndef CHARTABLES_H
-#define CHARTABLES_H
+#ifndef GCC_CHARTABLES_H
+#define GCC_CHARTABLES_H
 
 #define LETTER_START 1
 #define LETTER_PART  2
@@ -3209,4 +3209,4 @@ static const char *const type_table[256]
   page255
 };
 
-#endif /* CHARTABLES_H */
+#endif /* ! GCC_CHARTABLES_H */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]