--- p/declarations.c.orig Mon Feb 14 21:58:14 2005 +++ p/declarations.c Mon Feb 14 22:01:01 2005 @@ -2418,9 +2418,15 @@ if ((structor || !restype || (restype == void_type_node && TREE_TYPE (TREE_TYPE (old)) == void_type_node)) && !resvar && !arg && !empty_parentheses) ok = 1; - else if (DECL_LANG_RESULT_VARIABLE (old) != resvar - || !restype || !strictly_comp_types (restype, TREE_TYPE (TREE_TYPE (old)))) + else if (!restype || !strictly_comp_types (restype, TREE_TYPE (TREE_TYPE (old)))) ok = 0; + else if (DECL_LANG_RESULT_VARIABLE (old) != resvar) + { + if (!DECL_LANG_RESULT_VARIABLE (old)) + chk_dialect ("omitting result variables in forward declarations is", GNU_PASCAL); + else + ok = 0; + } else { for (; arg && old_arg; arg = TREE_CHAIN (arg), old_arg = TREE_CHAIN (old_arg)) --- p/test/fjf944a.pas.orig Mon May 17 00:52:22 2004 +++ p/test/fjf944a.pas Mon Feb 14 22:27:30 2005 @@ -1,3 +1,5 @@ +{$object-pascal} + program fjf944a; function f: Integer; forward;