public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/48785] New: BOZ editing of real numbers not working with -std=f2008
@ 2011-04-27  6:27 thenlich at users dot sourceforge.net
  2011-04-27  7:03 ` [Bug libfortran/48785] " burnus at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-04-27  6:27 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: BOZ editing of real numbers not working with
                    -std=f2008
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


The B, O and Z edit descriptors are not accepted for output of real numbers
when Fortran 2008 standard mode is selected.

Fortran 2008 explicitly allows B, O and Z editing for real and complex numbers.
(This is different from Fortran 2003, which only specifies B, O and Z editing
for integer numbers. This has been discussed in Bug 41711.)

10.7.2.4 B, O, and Z editing
1 [...] The corresponding input/output list item shall be of type integer,
real, or complex.
...
4 The value is INT (X) if the input list item is of type integer and REAL (X)
if the input list item is of type real or complex, where X is a
boz-literal-constant that specifies the same bit sequence as the digits of the
input field.

The following program, when compiled with "-std=f2008" fails with:

                                                         1111011
At line 3 of file test_boz.f90 (unit = 6, file = 'stdout')
Fortran runtime error: Expected INTEGER for item 1 in formatted transfer, got
REAL
(b64)
 ^

program test_boz
    print "(b64)", 123
    print "(b64)", 1.23
    print "(b0)", 123
    print "(b0)", 1.23
    print "(o24)", 123
    print "(o24)", 1.23
    print "(o0)", 123
    print "(o0)", 1.23
    print "(z0)", 123
    print "(z0)", 1.23
    print "(z16)", 123
    print "(z16)", 1.23

    print "(b64.64)", 123
    print "(b64.64)", 1.23
    print "(b0.64)", 123
    print "(b0.64)", 1.23
    print "(o24.24)", 123
    print "(o24.24)", 1.23
    print "(o0.24)", 123
    print "(o0.24)", 1.23
    print "(z0.16)", 123
    print "(z0.16)", 1.23
    print "(z16.16)", 123
    print "(z16.16)", 1.23
end program test_boz

The expected behavior is the same as without the "-std=f2008" option. The
program should output:
                                                         1111011
                                  111111100111010111000010100100
1111011
111111100111010111000010100100
                     173
              7747270244
173
7747270244
7B
3F9D70A4
              7B
        3F9D70A4
0000000000000000000000000000000000000000000000000000000001111011
0000000000000000000000000000000000111111100111010111000010100100
0000000000000000000000000000000000000000000000000000000001111011
0000000000000000000000000000000000111111100111010111000010100100
000000000000000000000173
000000000000007747270244
000000000000000000000173
000000000000007747270244
000000000000007B
000000003F9D70A4
000000000000007B
000000003F9D70A4


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

end of thread, other threads:[~2013-01-02 20:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-27  6:27 [Bug libfortran/48785] New: BOZ editing of real numbers not working with -std=f2008 thenlich at users dot sourceforge.net
2011-04-27  7:03 ` [Bug libfortran/48785] " burnus at gcc dot gnu.org
2011-05-02 13:04 ` thenlich at users dot sourceforge.net
2011-05-02 13:08 ` jvdelisle at gcc dot gnu.org
2011-05-02 13:15 ` thenlich at users dot sourceforge.net
2011-05-02 13:45 ` burnus at gcc dot gnu.org
2011-05-02 14:11 ` thenlich at users dot sourceforge.net
2011-05-02 14:36 ` burnus at gcc dot gnu.org
2011-05-02 15:14 ` thenlich at users dot sourceforge.net
2013-01-02 20:03 ` jvdelisle at gcc dot gnu.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).