This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/29625] New: Octal edit descriptors allow real variables, even with -std=f95


(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


-- 
           Summary: Octal edit descriptors allow real variables, even with -
                    std=f95
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: brooks at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]