Hi, the following code compiles and runs, but gives output that is incompatible with other tested F95 compilers:
program gfcbug18 real :: x = 1.23 ! Minimum width formatting: ! gfortran prints "# 1.23#", i.e., a leading blank where other compilers won't write(*, "('#',F0.2,'#')") x end program gfcbug18 gfortran prints # 1.23# E.g., Intel's ifc/ifort print #1.23# i.e., no leading blank. The Fortran 95 standard appears to allow this behavior: "10.5.1.2.1 F editing The Fw.d edit descriptor indicates that the field occupies w positions, the fractional part of which consists of d digits. When w is zero, the processor selects the field width. [...]" but it would be nice to have the same behavior as other products. It would also be compatible with integer editing, where I0 right now works as expected. Cheers, -ha -- Summary: libgfortran: format, incompatible "minimum width" edit descriptor Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: minor Priority: P2 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: anlauf at hep dot tu-darmstadt dot de CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18025