public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27996]  New: Compile time warn for:  character(2) :: str = 'ABC' (expression truncated)
@ 2006-06-12 10:25 tobias dot burnus at physik dot fu-berlin dot de
  2006-06-13 17:26 ` [Bug fortran/27996] " pault at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-06-12 10:25 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-01-14 14:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-12 10:25 [Bug fortran/27996] New: Compile time warn for: character(2) :: str = 'ABC' (expression truncated) tobias dot burnus at physik dot fu-berlin dot de
2006-06-13 17:26 ` [Bug fortran/27996] " pault at gcc dot gnu dot org
2006-06-23 13:59 ` tobias dot burnus at physik dot fu-berlin dot de
2006-11-29 20:01 ` patchapp at dberlin dot org
2007-01-05 14:46 ` pault at gcc dot gnu dot org
2007-01-14 14:51 ` [Bug fortran/27996] [4.2 and 4.1 only] " pault at gcc dot gnu dot org
2007-01-14 14:53 ` [Bug fortran/27996] [4.1 " pault at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).