From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29097 invoked by alias); 12 Mar 2010 12:31:48 -0000 Received: (qmail 29037 invoked by uid 48); 12 Mar 2010 12:31:35 -0000 Date: Fri, 12 Mar 2010 12:31:00 -0000 Message-ID: <20100312123135.29036.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/43298] fortran library does not read in NaN -Inf or Inf In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus 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-03/txt/msg01142.txt.bz2 ------- Comment #4 from burnus at gcc dot gnu dot org 2010-03-12 12:31 ------- Actually, in list_read.c's parse_real gfortran already handles inf(inity) and nan (_but_ _not _"nan(string)"). Thus, using 'read(*,*) a' works. * * * The TODO quote from comment 2 is for read.c's "convert_real"; however, as this only calls strto(d,f,ld), I do not see a problem on POSIX/C99 systems. I think the actual problem is read.c's "read_f" which cannot parse NaN/INF and gives a "goto bad" error. I think one should do something similar to list_read.c's parse_real. For completeness, the strtod, strtof, strtold of C99/POSIX supports: * One of INF or INFINITY, ignoring case * One of NAN or NAN(n-char-sequence_opt), ignoring case in the NAN part, where: n-char-sequence: digit nondigit n-char-sequence digit n-char-sequence nondigit -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43298