From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21979 invoked by alias); 22 Jan 2011 13:54:39 -0000 Received: (qmail 21970 invoked by uid 22791); 22 Jan 2011 13:54:39 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_JV X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 22 Jan 2011 13:54:25 +0000 From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/47285] G format outputs wrong number of characters when decimal supplied in literal X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sat, 22 Jan 2011 14:26:00 -0000 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: 2011-01/txt/msg02306.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47285 --- Comment #4 from Jerry DeLisle 2011-01-22 13:53:52 UTC --- Created attachment 23076 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23076 A possible patch This patch seems to be acceptable. I add a try return value to output float to communicate when the field width is not successful. Oddly, I had to make an adjustment to the exponent width to take care of a case that returns successfully. if (e > 4)\ e = 4;\ This seems to work, but I wonder if I have a latent bug within. This patch does regression test OK. I thought I would let others play with it before I submit.