public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/38097]  New: gfortran does not allow blanks in exponent in float (even with BN)
@ 2008-11-12 22:45 jjcogliati-r1 at yahoo dot com
  2008-11-13 15:50 ` [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor burnus at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jjcogliati-r1 at yahoo dot com @ 2008-11-12 22:45 UTC (permalink / raw)
  To: gcc-bugs

The following program works in g77, but gets an 'Bad value during floating
point read' error in gfortran.  

c     blank_test.f program
      character(11)  :: a = ' 2.0030e+ 3'
      real :: f

      read (a,'(BN,E11.0)'),f
      print *,f

      end
c     end of program


I think that ' 2.0030e+ 3' should be a proper floating point value when BN
editing is enabled.  I am not sure what this should do when blank processing is
unspecified.


-- 
           Summary: gfortran does not allow blanks in exponent in float
                    (even with BN)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jjcogliati-r1 at yahoo dot com
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38097


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor
  2008-11-12 22:45 [Bug libfortran/38097] New: gfortran does not allow blanks in exponent in float (even with BN) jjcogliati-r1 at yahoo dot com
@ 2008-11-13 15:50 ` burnus at gcc dot gnu dot org
  2008-11-14  4:34 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-11-13 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2008-11-13 15:49 -------
Jerry, can you have a look? Using ifort it prints:  2003.000
and it seems to be valid Fortran 95/2003.

"10.7.6 BN and BZ editing"

"The BN and BZ edit descriptors temporarily change (9.4.1) the blank
interpretation mode (9.4.5.4, 9.5.1.5) for the connection. The edit descriptors
BN and BZ set the blank interpretation mode corresponding to the BLANK=
specifier values NULL and ZERO, respectively. The blank interpretation mode
controls the interpretation of nonleading blanks in numeric input fields. Such
blank characters are interpreted as zeros when the blank interpretation mode
has the value ZERO; they are ignored when the blank interpretation mode has the
value NULL. The effect of ignoring blanks is to treat the input field as if
blanks had been removed, the remaining portion of the field right justified,
and the blanks replaced as leading blanks. However, a field containing only
blanks has the value zero.

"The blank interpretation mode affects only numeric editing (10.6.1) and
generalized numeric editing (10.6.4.1) on input. It has no effect on output."

"9.4.5.4 BLANK= specifier in the OPEN statement
"The scalar-default-char-expr shall evaluate to NULL or ZERO. The BLANK=
specifier is permitted only for a connection for formatted input/output. It
specifies the current value of the blank interpretation mode (10.7.6, 9.5.1.5)
for input for this connection. This mode has no effect on output. It is a
changeable mode (9.4.1). If this specifier is omitted in an OPEN statement that
initiates a connection, the default value is NULL."


Thus it should work with default settings. Not surprisingly (as g77 works),
BZ/BN are also part of Fortran 95.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|x86_64-redhat-linux         |
   GCC host triplet|x86_64-redhat-linux         |
 GCC target triplet|x86_64-redhat-linux         |
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2008-11-13 15:49:23
               date|                            |
            Summary|gfortran does not allow     |I/O with blanks in exponent
                   |blanks in exponent in float |fails; blank="NULL", BN edit
                   |(even with BN)              |descriptor


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38097


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor
  2008-11-12 22:45 [Bug libfortran/38097] New: gfortran does not allow blanks in exponent in float (even with BN) jjcogliati-r1 at yahoo dot com
  2008-11-13 15:50 ` [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor burnus at gcc dot gnu dot org
@ 2008-11-14  4:34 ` jvdelisle at gcc dot gnu dot org
  2008-11-16 16:15 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-11-14  4:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2008-11-14 04:33 -------
I am on it.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-11-13 15:49:23         |2008-11-14 04:33:24
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38097


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor
  2008-11-12 22:45 [Bug libfortran/38097] New: gfortran does not allow blanks in exponent in float (even with BN) jjcogliati-r1 at yahoo dot com
  2008-11-13 15:50 ` [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor burnus at gcc dot gnu dot org
  2008-11-14  4:34 ` jvdelisle at gcc dot gnu dot org
@ 2008-11-16 16:15 ` jvdelisle at gcc dot gnu dot org
  2008-11-16 16:21 ` jvdelisle at gcc dot gnu dot org
  2008-11-16 16:24 ` jvdelisle at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-11-16 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2008-11-16 16:13 -------
Subject: Bug 38097

Author: jvdelisle
Date: Sun Nov 16 16:12:16 2008
New Revision: 141919

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141919
Log:
2008-11-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/38097
        * io/read.c (read_f): Initialize exponent. Fix comment. Set loop
        conditions for BZ/BN.
        * io/unit.c (get_internal_unit): Initialize flags.blank.
        * io/transfer.c (data_transfer_init): Fix whitespace.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/read.c
    trunk/libgfortran/io/transfer.c
    trunk/libgfortran/io/unit.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38097


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor
  2008-11-12 22:45 [Bug libfortran/38097] New: gfortran does not allow blanks in exponent in float (even with BN) jjcogliati-r1 at yahoo dot com
                   ` (2 preceding siblings ...)
  2008-11-16 16:15 ` jvdelisle at gcc dot gnu dot org
@ 2008-11-16 16:21 ` jvdelisle at gcc dot gnu dot org
  2008-11-16 16:24 ` jvdelisle at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-11-16 16:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2008-11-16 16:20 -------
Subject: Bug 38097

Author: jvdelisle
Date: Sun Nov 16 16:18:36 2008
New Revision: 141920

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141920
Log:
2008-11-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/38097
        * gfortran.dg/fmt_bz_bn.f: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/fmt_bz_bn.f
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38097


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor
  2008-11-12 22:45 [Bug libfortran/38097] New: gfortran does not allow blanks in exponent in float (even with BN) jjcogliati-r1 at yahoo dot com
                   ` (3 preceding siblings ...)
  2008-11-16 16:21 ` jvdelisle at gcc dot gnu dot org
@ 2008-11-16 16:24 ` jvdelisle at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-11-16 16:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2008-11-16 16:22 -------
Fixed on trunk


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38097


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-16 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-12 22:45 [Bug libfortran/38097] New: gfortran does not allow blanks in exponent in float (even with BN) jjcogliati-r1 at yahoo dot com
2008-11-13 15:50 ` [Bug libfortran/38097] I/O with blanks in exponent fails; blank="NULL", BN edit descriptor burnus at gcc dot gnu dot org
2008-11-14  4:34 ` jvdelisle at gcc dot gnu dot org
2008-11-16 16:15 ` jvdelisle at gcc dot gnu dot org
2008-11-16 16:21 ` jvdelisle at gcc dot gnu dot org
2008-11-16 16:24 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).