From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21535 invoked by alias); 29 Feb 2012 08:51:06 -0000 Received: (qmail 21525 invoked by uid 22791); 29 Feb 2012 08:51:04 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Wed, 29 Feb 2012 08:50:51 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52428] [RFC] I/O: READING of "-huge()-1": Integer overflow Date: Wed, 29 Feb 2012 09:09: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC 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 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: 2012-02/txt/msg02765.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52428 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #1 from Tobias Burnus 2012-02-29 08:50:33 UTC --- Post scriptum: * For read (*, '(i18)') i the value -2147483648 is accepted But only if one has compiled the main program with -fno-range-check. Cf. libgfortran/io/read.c's read_decimal function. * For read (*, *) i the value -2147483648 is always rejected, independent of that flag. Cf. libgfortran/io/list_read.c's convert_integer function. Expected: * A list-directed read gives the same result as a read with an edit descriptor. * The value is always accepted - even without -fno-range-check. This flag is completely nontransparent (with regards to the run-time library), it only works if the main program is compiled with that flag, and not even the documentation of the flag mentions that the run-time library is affected. See: -fno-range-check at http://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html Admittedly, it is mentioned at http://gcc.gnu.org/onlinedocs/gfortran/_005fgfortran_005fset_005foptions.html