GPC does not accept conformant array bounds of enum types.
Fixed (pd2.pas). Patch below.
--
Peter Gerwinski, Essen, Germany,
http://home.pages.de/~Peter.Gerwinski/
Maintainer GNU Pascal -
http://home.pages.de/~GNU-Pascal/ - gpc-19990118
PGP key on request - 6C 94 45 BE 28 A4 96 - 0E CC E9 12 47 25 82 75
*** Vote against SPAM! *********
http://www.politik-digital.de/spam/ ***
--- gpc-typeck.c.orig Sun Apr 11 00:20:50 1999
+++ gpc-typeck.c Thu Jun 17 01:23:30 1999
@@ -544,7 +544,7 @@
/* Enumeral types must match almost exactly.
*/
if (TREE_CODE (t1) == ENUMERAL_TYPE || TREE_CODE (t2) == ENUMERAL_TYPE)
- return base_type (t1) == base_type (t2) ? 1 : 0;
+ return TYPE_VALUES (base_type (t1)) == TYPE_VALUES (base_type (t2)) ? 1 : 0;
#else /* not GPC */
@@ -1762,7 +1762,7 @@
enum tree_code code0 = TREE_CODE (type0);
enum tree_code code1 = TREE_CODE (type1);
if (code0 == ENUMERAL_TYPE || code1 == ENUMERAL_TYPE)
- return base_type (type0) == base_type (type1);
+ return comptypes (type0, type1);
else
return (code0 == code1)
|| (code0 == REAL_TYPE && code1 == INTEGER_TYPE)
@@ -2743,6 +2743,8 @@
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
if (TREE_CODE (val) == NON_LVALUE_EXPR)
val = TREE_OPERAND (val, 0);
+
+ val = convert (TYPE_DOMAIN (atype), val);
}
/* Used one index */