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/27996] New: Compile time warn for: character(2) :: str = 'ABC' (expression truncated)


In the following, the assignment to str gets truncated twice.
gfortran -Wall does not give any warning.

Expected: As similar warning as NAG gives:
  Warning: trunc.f90, line 2: Initialisation expression for STR truncated
At least the first initalization should be detected, possibly also the second.
Such error messaging works for real, dimension(3) :: [1.0, 2.0, 3.0] at both
places:
  Error: different shape for Array assignment at (1) on dimension 1 (2/3)

---------------
program test
  character(2) :: c = 'AAA'
  c = 'ABC'
  print *, c
end program test
---------------


-- 
           Summary: Compile time warn for:  character(2) :: str = 'ABC'
                    (expression truncated)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobias dot burnus at physik dot fu-berlin dot de


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


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