From patchwork Fri Jul 2 19:07:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 57752 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 B0935B70C1 for ; Sat, 3 Jul 2010 05:08:06 +1000 (EST) Received: (qmail 19750 invoked by alias); 2 Jul 2010 19:08:04 -0000 Received: (qmail 19731 invoked by uid 22791); 2 Jul 2010 19:08:02 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE 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; Fri, 02 Jul 2010 19:07:56 +0000 Received: from [192.168.178.22] (port-92-204-8-198.dynamic.qsc.de [92.204.8.198]) by mx01.qsc.de (Postfix) with ESMTP id 980E63DC08; Fri, 2 Jul 2010 21:07:41 +0200 (CEST) Message-ID: <4C2E38FB.3030400@net-b.de> Date: Fri, 02 Jul 2010 21:07:39 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.10) Gecko/20100520 SUSE/3.0.5 Thunderbird/3.0.5 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran, committed] PR 43298 - Use NAN not NAN(...) for strtod 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 Seemingly HPUX's strtod does not like "NAN(alphanum)" which is allowed according to POSIX but what it does is implementation defined. Well, as it does not work, I use the simplest (implementation defined) solution: I only pass NAN to strtod - ignoring the (...) part. The patch was reviewed by Jerry in the PR and build/regtested on x86-64-linux. Committed as Rev. 161735. Tobias Index: libgfortran/ChangeLog =================================================================== --- libgfortran/ChangeLog (Revision 161734) +++ libgfortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,9 @@ +2010-06-28 Tobias Burnus + + PR fortran/43298 + * list_read.c (parse_real): Do not pass (..) on for NAN(..). + * read.c (convert_real): Fix comment about NAN/INF. + 2010-07-02 Rainer Orth * configure.ac (gfortran_use_symver): Only check for Sun-style symbol Index: libgfortran/io/list_read.c =================================================================== --- libgfortran/io/list_read.c (Revision 161734) +++ libgfortran/io/list_read.c (Arbeitskopie) @@ -1206,10 +1206,7 @@ parse_real (st_parameter_dt *dtp, void * for ( ; c != ')'; c = next_char (dtp)) if (is_separator (c)) goto bad; - else - push_char (dtp, c); - push_char (dtp, ')'); c = next_char (dtp); if (is_separator (c)) unget_char (dtp, c); Index: libgfortran/io/read.c =================================================================== --- libgfortran/io/read.c (Revision 161734) +++ libgfortran/io/read.c (Arbeitskopie) @@ -131,11 +131,10 @@ max_value (int length, int signed_flag) /* convert_real()-- Convert a character representation of a floating - * point number to the machine number. Returns nonzero if there is a - * range problem during conversion. Note: many architectures - * (e.g. IA-64, HP-PA) require that the storage pointed to by the dest - * argument is properly aligned for the type in question. TODO: - * handle not-a-numbers and infinities. */ + point number to the machine number. Returns nonzero if there is a + range problem during conversion. Note: many architectures + (e.g. IA-64, HP-PA) require that the storage pointed to by the dest + argument is properly aligned for the type in question. */ int convert_real (st_parameter_dt *dtp, void *dest, const char *buffer, int length)