Bastiaan Veelo wrote:
My version is gpc 20051116, based on gcc-3.2.3 (mingw special 20030504-1). Indeed, the program compiles. The problem begins after uncommenting the initial value. Sorry for the confusion :-) For completeness here follows the code that _does not_ compile as is.
program stringtest;
type record_with_empty_string = record empty_string : string(127) VALUE ''; end; some_records_with_empty_string(length : integer) = array[1..length] of record_with_empty_string; five_records_with_empty_string = some_records_with_empty_string(5);
begin end.
Yes, this is a bug. The following should fix it:
Index: typecheck.c =================================================================== RCS file: /mn/a8/cvsroot/gpc/p/typecheck.c,v retrieving revision 1.12 diff -u -p -r1.12 typecheck.c --- typecheck.c 11 Apr 2006 04:33:16 -0000 1.12 +++ typecheck.c 24 Jul 2006 14:08:02 -0000 @@ -2624,11 +2659,13 @@ build_discriminated_schema_type (tree ty tree t = re_fold (TYPE_LANG_INITIAL (type), TYPE_MAIN_VARIANT (type_template), fix_list, &dummy); CHK_EM (t); +#if 0 if (check_pascal_initializer (type, t)) { error ("initial value of discriminated schema type is of wrong type"); t = error_mark_node; } +#endif TYPE_LANG_INITIAL (type) = t; }