The current g0.w edit descriptor implementation is based on the F2008 comment resolution at J3 resolution. Afterwards there was the Tokyo WG5, which also addressed ISO member comments. Unfortunately, the g0.<w> was changed a bit.
At the WG5 meeting in Tokyo, one agreed on the following modified version, see ftp://ftp.nag.co.uk/sc22wg5/N1751-N1800/N1760.txt: "2.6 Generalized output editing A similar feature has been added, see 08-296r2." That is the following paper: http://www.j3-fortran.org/doc/year/08/08-296r2.txt I think the current implementation (see PR 37228) is based on http://j3-fortran.org/doc/year/08/08-251r3.txt and http://www.j3-fortran.org/doc/year/08/08-272.html "In the original J3 response, 08-251r3, G0.d, like G0, was defined in terms of the ESw.d format, meaning that even values close to zero would be shown in E format, unlike the Gw.d format (for w>0) which would choose F format for such values. N1743 suggested that G0 and G0.d behave more like Gw.d in such cases and J3 agrees." Currently, gfortran prints: 3.4500E+00 ES10.4 3.4500 F10.4 3.450 g10.4 3.4500E+00 g0.4 Note that contrary to the other edit descriptors: "that any leading or trailing blanks are removed. If I read the new proposal correctly, the out should not be: "3.450" without heading spaces. * * * Per C1007+, the e<d> may not be specified for g0, e.g. "g0.4e4" gfortran rejects this, but with a rather strange error message: print '(g0.4e4)', 3.45 1 Error: Period required in format specifier at (1) -- Summary: g0.w edit descriptor: Update for F2008 Tokyo meeting changes Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38398