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: unassig...@gcc.gnu.org ReportedBy: thenl...@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