summaryrefslogtreecommitdiff
path: root/compiler/pdecsub.pas
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-12-16 22:22:11 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-12-16 22:22:11 +0000
commitf5266a8a1b139e65a366b2ec6534f2ab1bdf8bc0 (patch)
tree2680a53efd1595a4e6ebd32b7c467e1b89f3a460 /compiler/pdecsub.pas
parentefce2b04e97282bdcce3db1bfd667fe8445033fc (diff)
downloadfpc-f5266a8a1b139e65a366b2ec6534f2ab1bdf8bc0.tar.gz
+ new cpo_openequalisexact parameter comparison option which
treats equal open arrays, open strings and arrays of const (implicitly also open) as exactly matching (since you cannot declare such types on their own, so they will never match exactly) * require that forward declared procedures match the implementation exactly for both the parameters (with the above modification) and result type (mantis #10425 and the related webtbf/tw10425a.pp) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@9484 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/pdecsub.pas')
-rw-r--r--compiler/pdecsub.pas19
1 files changed, 6 insertions, 13 deletions
diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas
index 1955f40fe3..046c8e0c1d 100644
--- a/compiler/pdecsub.pas
+++ b/compiler/pdecsub.pas
@@ -2529,15 +2529,8 @@ const
{ check arguments, we need to check only the user visible parameters. The hidden parameters
can be in a different location because of the calling convention, eg. L-R vs. R-L order (PFV) }
(
- (compare_paras(currpd.paras,fwpd.paras,cp_none,[cpo_comparedefaultvalue,cpo_ignorehidden])>=te_equal) and
- { for operators equal_paras is not enough !! }
- ((currpd.proctypeoption<>potype_operator) or (optoken<>_ASSIGNMENT) or
- { be careful here, equal_defs doesn't take care of unique }
- (fwpd.returndef=currpd.returndef) or
- (equal_defs(fwpd.returndef,currpd.returndef) and
- not(df_unique in fwpd.returndef.defoptions) and not(df_unique in currpd.returndef.defoptions)
- )
- )
+ (compare_paras(currpd.paras,fwpd.paras,cp_none,[cpo_comparedefaultvalue,cpo_ignorehidden,cpo_openequalisexact])=te_exact) and
+ (fwpd.returndef=currpd.returndef)
) then
begin
{ Check if we've found the forwarddef, if found then
@@ -2549,9 +2542,9 @@ const
if not(m_repeat_forward in current_settings.modeswitches) and
(fwpd.proccalloption<>currpd.proccalloption) then
- paracompopt:=[cpo_ignorehidden,cpo_comparedefaultvalue]
+ paracompopt:=[cpo_ignorehidden,cpo_comparedefaultvalue,cpo_openequalisexact]
else
- paracompopt:=[cpo_comparedefaultvalue];
+ paracompopt:=[cpo_comparedefaultvalue,cpo_openequalisexact];
{ Check calling convention }
if (fwpd.proccalloption<>currpd.proccalloption) then
@@ -2588,8 +2581,8 @@ const
also the parameters must match also with the type }
if ((m_repeat_forward in current_settings.modeswitches) or
not is_bareprocdef(currpd)) and
- ((compare_paras(currpd.paras,fwpd.paras,cp_all,paracompopt)<te_equal) or
- (not equal_defs(fwpd.returndef,currpd.returndef))) then
+ ((compare_paras(currpd.paras,fwpd.paras,cp_all,paracompopt)<>te_exact) or
+ (fwpd.returndef<>currpd.returndef)) then
begin
MessagePos1(currpd.fileinfo,parser_e_header_dont_match_forward,
fwpd.fullprocname(false));