From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6065 invoked by alias); 21 Jul 2014 17:58:43 -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 Received: (qmail 5945 invoked by uid 48); 21 Jul 2014 17:58:39 -0000 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/61847] bug in gfortran runtime on OSX: digits cut off when reading floating point number Date: Mon, 21 Jul 2014 17:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.8.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-07/txt/msg01468.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61847 --- Comment #6 from kargl at gcc dot gnu.org --- (In reply to kargl from comment #4) > (In reply to e2cd58e1 from comment #3) > > but what I want to do is read in values with point as decimal separator. > > Using > > > > open(unit=1,file='bug.dat', decimal="point") > > > > doesn't seem to change anything. > > gfortran's IO for floating point numbers using the operating > systems strtof, strtod, and strtold. Are you sure that these > functions on yuor OS actual have working locale support? Yeah, replying to myself. What happens if you give strtod "1.2345' and "1,2345" in your locale? I missed a section of code in io/read.c: case ',': if (dtp->u.p.current_unit->decimal_status != DECIMAL_COMMA) goto bad_float; /* Fall through. */ case '.': if (seen_dp) goto bad_float; if (!seen_int_digit) *(out++) = '0'; *(out++) = '.'; seen_dp = 1; break; This implicitly changes a comma into a decimal point prior to the call to strtod.