From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17604 invoked by alias); 24 Feb 2010 04:01:22 -0000 Received: (qmail 16227 invoked by uid 48); 24 Feb 2010 04:01:06 -0000 Date: Wed, 24 Feb 2010 04:01:00 -0000 Message-ID: <20100224040106.16226.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/43155] Reading real numbers of the form "123+ 44" (with space) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jvdelisle at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg02408.txt.bz2 ------- Comment #3 from jvdelisle at gcc dot gnu dot org 2010-02-24 04:01 ------- Here is the fix: Index: transfer.c =================================================================== --- transfer.c (revision 156986) +++ transfer.c (working copy) @@ -926,7 +926,7 @@ require_type (st_parameter_dt *dtp, bt expected, b return 0; sprintf (buffer, "Expected %s for item %d in formatted transfer, got %s", - type_name (expected), dtp->u.p.item_count, type_name (actual)); + type_name (expected), dtp->u.p.item_count - 1, type_name (actual)); format_error (dtp, f, buffer); return 1; The reason this is the right fix is that for formatted transfers, the loop that calls the transfers is executed an initial time to set up the transfer and then looped throughthe items. Item count is always one greater. We could initialize it to -1, but why bother, the dtp structure is zeroed when created. The above is the minimal fix. I will add a comment to explain this when I commit. Regression tests OK. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43155