From patchwork Wed Aug 4 08:56:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 60835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D959AB70A7 for ; Wed, 4 Aug 2010 18:57:05 +1000 (EST) Received: (qmail 5131 invoked by alias); 4 Aug 2010 08:57:02 -0000 Received: (qmail 5106 invoked by uid 22791); 4 Aug 2010 08:57:00 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_BG X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Aug 2010 08:56:54 +0000 Received: from [192.168.178.22] (port-92-204-54-162.dynamic.qsc.de [92.204.54.162]) by mx01.qsc.de (Postfix) with ESMTP id B1BC93D27C; Wed, 4 Aug 2010 10:56:51 +0200 (CEST) Message-ID: <4C592B52.50508@net-b.de> Date: Wed, 04 Aug 2010 10:56:50 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100714 SUSE/3.1.1 Thunderbird/3.1.1 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran, committed] Fix return value of some I/O functions in trans-io.c Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Committed as obvious. Cf. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45131#c9 The functions are declared as "void" in libgfortran - thus, the FE should have the same declaration. This might be a bug introduced with the recent gfc_build_library_function_decl_with_spec annotation, but maybe it is older (I have not checked). Build and regtested on x86-64-linux. Committed as Rev. 162857. Tobias Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (revision 162856) +++ gcc/fortran/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2010-08-04 Tobias Burnus + + * trans-io.c (gfc_build_io_library_fndecls): Fix return + value of some libgfortran functions. + 2010-08-03 Thomas Koenig PR fortran/45159 Index: gcc/fortran/trans-io.c =================================================================== --- gcc/fortran/trans-io.c (revision 162856) +++ gcc/fortran/trans-io.c (working copy) @@ -362,7 +362,7 @@ gfc_build_io_library_fndecls (void) parm_type = build_pointer_type (st_parameter[IOPARM_ptype_inquire].type); iocall[IOCALL_INQUIRE] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_inquire")), ".w", - gfc_int4_type_node, 1, parm_type); + void_type_node, 1, parm_type); iocall[IOCALL_IOLENGTH] = gfc_build_library_function_decl_with_spec( get_identifier (PREFIX("st_iolength")), ".w", @@ -372,43 +372,43 @@ gfc_build_io_library_fndecls (void) parm_type = build_pointer_type (st_parameter[IOPARM_ptype_wait].type); iocall[IOCALL_WAIT] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_wait")), ".X", - gfc_int4_type_node, 1, parm_type); + void_type_node, 1, parm_type); parm_type = build_pointer_type (st_parameter[IOPARM_ptype_filepos].type); iocall[IOCALL_REWIND] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_rewind")), ".w", - gfc_int4_type_node, 1, parm_type); + void_type_node, 1, parm_type); iocall[IOCALL_BACKSPACE] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_backspace")), ".w", - gfc_int4_type_node, 1, parm_type); + void_type_node, 1, parm_type); iocall[IOCALL_ENDFILE] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_endfile")), ".w", - gfc_int4_type_node, 1, parm_type); + void_type_node, 1, parm_type); iocall[IOCALL_FLUSH] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_flush")), ".w", - gfc_int4_type_node, 1, parm_type); + void_type_node, 1, parm_type); /* Library helpers */ iocall[IOCALL_READ_DONE] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_read_done")), ".w", - gfc_int4_type_node, 1, dt_parm_type); + void_type_node, 1, dt_parm_type); iocall[IOCALL_WRITE_DONE] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_write_done")), ".w", - gfc_int4_type_node, 1, dt_parm_type); + void_type_node, 1, dt_parm_type); iocall[IOCALL_IOLENGTH_DONE] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_iolength_done")), ".w", - gfc_int4_type_node, 1, dt_parm_type); + void_type_node, 1, dt_parm_type); iocall[IOCALL_SET_NML_VAL] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_set_nml_var")), ".w.R", void_type_node, 6, dt_parm_type, pvoid_type_node, pvoid_type_node, - gfc_int4_type_node, gfc_charlen_type_node, gfc_int4_type_node); + void_type_node, gfc_charlen_type_node, gfc_int4_type_node); iocall[IOCALL_SET_NML_VAL_DIM] = gfc_build_library_function_decl_with_spec ( get_identifier (PREFIX("st_set_nml_var_dim")), ".w",