[Mono-dev] Error in eglib while compiling mono under Windows\VS2008

Alexander M. Batishchev abatishchev at godfather.net.ru
Wed Nov 5 13:36:32 EST 2008

Hello everybody,

I'm trying to compile Mono from SVN under VS 2008. Opened mono\msvc\mono.sln
and got error (after successful conversion of course) in eglib:

First of all options Threat warnings as errors is On, could you please say
me what for?
Line 1854 in mono\eglib\src\unicode-data.h:
simple_upper_case_mapping_lowarea_table_count = 8;
instead of
int simple_upper_case_mapping_lowarea_table_count = 8;

And i got broken compilation immediately because of
Warning C4431: missing type specifier - int assumed. Note: C no longer
supports default-int
Warning C4218: nonstandard extension used : must specify at least a storage
class or a type
Ok, add int and go to my general problem.

Lines after 123 in mono\eglib\src\gunicode.c:
g_unichar_case (gunichar c, gboolean upper)
	gint8 i, i2 = 0;
	guint32 cp = (guint32) c, v;

	for (i = 0; i < simple_case_map_ranges_count; i++) {
		if (cp < simple_case_map_ranges [i].start)
			return c;
		if (simple_case_map_ranges [i].end <= cp)
		if (c < 0x10000) {
			guint16 *tab16 = upper ?
simple_upper_case_mapping_lowarea [i] : simple_lower_case_mapping_lowarea
			v = tab16 [cp - simple_case_map_ranges [i].start];
		} else {
			i2 = i - (upper ?
simple_upper_case_mapping_lowarea_table_count :
			guint32 *tab32 = upper ?
simple_upper_case_mapping_higharea [i2] : simple_lower_case_mapping_higharea
			v = tab32 [cp - simple_case_map_ranges [i].start];
		return v != 0 ? (gunichar) v : c;
	return c;

Error output:

Error C2275: 'guint32' : illegal use of this type as an expression
d:\visual studio 2008\projects\mono\trunk\mono\eglib\src\gunicode.c:139

Error  C2065: 'tab32' : undeclared identifier
d:\visual studio 2008\projects\mono\trunk\mono\eglib\src\gunicode.c:139

Error  C2065: 'tab32' : undeclared identifier
d:\visual studio 2008\projects\mono\trunk\mono\eglib\src\gunicode.c:140

Error  C2109: subscript requires array or pointer type
d:\visual studio 2008\projects\mono\trunk\mono\eglib\src\gunicode.c:140

Error is contained in line 138:
i2 = i - (upper ? simple_upper_case_mapping_lowarea_table_count :

If remove declaration of the variable from method's head and put it into the
line everything compiles good!
gint8  i2 = i - (upper ? simple_upper_case_mapping_lowarea_table_count :

Why it could be so?? Is it bug of Microsoft Visual C++ compiler or something
Thanks a lot for tip!

PS. Am I right to write it here or is there a better place to do that?

Best regards,
Alexander M. Batishchev

More information about the Mono-devel-list mailing list