public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31266]  New: Spurious(?) warning about character truncation
@ 2007-03-19 15:46 jellby at yahoo dot com
  2007-03-21 15:59 ` [Bug fortran/31266] " burnus at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jellby at yahoo dot com @ 2007-03-19 15:46 UTC (permalink / raw)
  To: gcc-bugs

When a component of a "custom" type is a character, taking a substring of it
triggers a warning about the variable being truncated (with -Wall). Maybe it is
not the correct syntax to get a substring out of a character component (still,
it works fine for printing, for example)?


$cat test.f90
PROGRAM test
  IMPLICIT NONE
  TYPE custom
    CHARACTER(LEN=10) :: nom
  END TYPE custom
  CHARACTER (LEN=10) :: a
  CHARACTER (LEN=2)  :: b
  TYPE(custom) :: c

  a='1234567890'
  b=a(1:2)
  c%nom=a
  b=c%nom(1:2)

END PROGRAM test

$gfortran -Wall -c test.f90
test1.f90:13.14:

  b=c%nom(1:2)
             1
Warning: rhs of CHARACTER assignment at (1) will be truncated (10/2)


-- 
           Summary: Spurious(?) warning about character truncation
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jellby at yahoo dot com


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


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

end of thread, other threads:[~2007-04-13 14:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
2007-03-21 15:59 ` [Bug fortran/31266] " burnus at gcc dot gnu dot org
2007-03-25 22:13 ` tobi at gcc dot gnu dot org
2007-04-10 14:14 ` tobi at gcc dot gnu dot org
2007-04-12 17:13 ` patchapp at dberlin dot org
2007-04-12 18:10 ` tobi at gcc dot gnu dot org
2007-04-13 13:51 ` tobi at gcc dot gnu dot org
2007-04-13 14:18 ` tobi 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).