+2010-08-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/45304
+ * trans-decl.c (build_library_function_decl_1): Chain on
+ void_list_node instead of creating a new TREE_LIST.
+ * trans-intrinsic.c (gfc_get_intrinsic_lib_fndecl): Likewise.
+ * trans-types.c (gfc_get_function_type): Likewise. Set
+ typelist to void_list_node for the main program.
+
2010-08-17 Daniel Kraft <d@domob.eu>
PR fortran/38936
if (nargs >= 0)
{
/* Terminate the list. */
- arglist = gfc_chainon_list (arglist, void_type_node);
+ arglist = chainon (arglist, void_list_node);
}
/* Build the function type and decl. */
type = gfc_typenode_for_spec (&actual->expr->ts);
argtypes = gfc_chainon_list (argtypes, type);
}
- argtypes = gfc_chainon_list (argtypes, void_type_node);
+ argtypes = chainon (argtypes, void_list_node);
type = build_function_type (gfc_typenode_for_spec (ts), argtypes);
fndecl = build_decl (input_location,
FUNCTION_DECL, get_identifier (name), type);
typelist = gfc_chainon_list (typelist, gfc_charlen_type_node);
if (typelist)
- typelist = gfc_chainon_list (typelist, void_type_node);
+ typelist = chainon (typelist, void_list_node);
+ else if (sym->attr.is_main_program)
+ typelist = void_list_node;
if (alternate_return)
type = integer_type_node;