* only allow cdecl "array of const" parameters for procvars and for external

routines (just like "varargs"), because if implemented in Pascal then
    on the callee side this array of const parameter is treated as a Pascal-
    style array of const
  * don't give the "cdecl'ared functions have no high parameter" warning for
    array of const parameters for cdecl external routines and procvars

git-svn-id: trunk@13618 -
This commit is contained in:
Jonas Maebe 2009-08-30 08:52:38 +00:00
parent ae6200ce72
commit ceb547d027
2 changed files with 7 additions and 2 deletions

View File

@ -298,8 +298,12 @@ implementation
begin
if is_open_string(vardef) then
MessagePos(fileinfo,parser_w_cdecl_no_openstring);
if not (po_external in pd.procoptions) then
MessagePos(fileinfo,parser_w_cdecl_has_no_high);
if not(po_external in pd.procoptions) and
(pd.typ<>procvardef) then
if is_array_of_const(vardef) then
MessagePos(fileinfo,parser_e_varargs_need_cdecl_and_external)
else
MessagePos(fileinfo,parser_w_cdecl_has_no_high);
end;
if (vardef.typ=formaldef) and (Tformaldef(vardef).typed) then
begin

View File

@ -1,3 +1,4 @@
{ %fail }
{ first simple array of const test }