From 47eb589d54d43ed07fa64fb299eeabaa957b1439 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 20 Aug 2006 15:14:07 +0000 Subject: [PATCH] * allow implicit conversions from/to packed char arrays under the same conditions as from/two regular char arrays (since a packed char array is the same as a string in ISO Pascal) git-svn-id: trunk@4468 - --- compiler/defcmp.pas | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/compiler/defcmp.pas b/compiler/defcmp.pas index 4bb4536df7..37c1fffc2a 100644 --- a/compiler/defcmp.pas +++ b/compiler/defcmp.pas @@ -601,9 +601,17 @@ implementation case def_from.deftype of arraydef : begin - { from/to packed array } - if is_packed_array(def_from) xor - is_packed_array(def_to) then + { from/to packed array -- packed chararrays are } + { strings in ISO Pascal (at least if the lower bound } + { is 1, but GPC makes all equal-length chararrays } + { compatible), so treat those the same as regular } + { char arrays } + if (is_packed_array(def_from) and + not is_chararray(def_from) and + not is_widechararray(def_from)) xor + (is_packed_array(def_to) and + not is_chararray(def_to) and + not is_widechararray(def_to)) then { both must be packed } begin compare_defs_ext:=te_incompatible;