(Fortran version: GNU Fortran 95 (GCC) 4.2.0 20061015 (experimental)) Consider the following program: ~/temp/gfortran> cat trans1.f90 program trans1 real :: a a = 1. write (*,"(10x, f9.5)" ) a write (*,"( 1x, o20)" ) transfer(a, 0) write (*,"( 1x, o20)" ) a end According to the Fortran 95 standard (section 10.5.1.1), the output list item corresponding to an "O" edit descriptor shall be of integer type. Although allowing real items is a perfectly reasonable extension when strict standard-conformance is not requested, when strict standard conformance is requested, the last of these write statements should produce an error. However, it does not: ~/temp/gfortran> gfortran -std=f95 -Wall trans1.f90 -o trans1.exe ~/temp/gfortran> ./trans1 1.00000 7740000000 7740000000
Probably the same for binary and hexadecimal? io/transfer.c(formatted_transfer_scalar): "case FMT_O:" seems to be a good place for adding notify_std (&dtp->common, GFC_STD_GNU,...)
Subject: Bug 29625 Author: burnus Date: Sat Oct 28 21:05:42 2006 New Revision: 118111 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118111 Log: 2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/29625 * io/transfer.c (formatted_transfer_scalar): Allow binary edit descriptors for real variables; give error for BOZ edit descriptor for non-integers when using -std=f*. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/transfer.c
Subject: Bug 29625 Author: burnus Date: Sat Oct 28 21:07:19 2006 New Revision: 118112 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118112 Log: 2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/29625 * gfortran.dg/io_real_boz.f90: Add. * gfortran.dg/io_real_boz2.f90: Add. Added: trunk/gcc/testsuite/gfortran.dg/io_real_boz.f90 trunk/gcc/testsuite/gfortran.dg/io_real_boz2.f90 Modified: trunk/gcc/testsuite/ChangeLog
Fix checked in: Author: burnus Date: Sat Oct 28 21:05:42 2006 New Revision: 118111 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118111 Log: 2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/29625 * io/transfer.c (formatted_transfer_scalar): Allow binary edit descriptors for real variables; give error for BOZ edit descriptor for non-integers when using -std=f*. Modified: trunk/libgfortran/ChangeLog trunk/libgfortran/io/transfer.c Author: burnus Date: Sat Oct 28 21:07:19 2006 New Revision: 118112 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118112 Log: 2006-10-28 Tobias Burnus <burnus@net-b.de> PR fortran/29625 * gfortran.dg/io_real_boz.f90: Add. * gfortran.dg/io_real_boz2.f90: Add. Added: trunk/gcc/testsuite/gfortran.dg/io_real_boz.f90 trunk/gcc/testsuite/gfortran.dg/io_real_boz2.f90 Modified: trunk/gcc/testsuite/ChangeLog
Mark fixed.