public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53685] New: surprising warns about transfer with explicit character range
@ 2012-06-15 14:35 ajmay81 at googlemail dot com
  2012-06-15 16:18 ` [Bug fortran/53685] " burnus at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ajmay81 at googlemail dot com @ 2012-06-15 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53685
           Summary: surprising warns about transfer with explicit
                    character range
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ajmay81@googlemail.com


Fortran code:

      subroutine test()
      implicit none
      character(len=4) :: record_type
      integer          :: i
      i=transfer(record_type,i) ! no warning
      i=transfer(record_type(1:4),i) ! warning
      return
      end

gfortran -c -Wsurprising test.f
test.f:6.17:

      i=transfer(record_type(1:4),i) ! warning                          
                 1
Warning: Intrinsic TRANSFER at (1) has partly undefined result: source size 0 <
result size 4

When the string length is explicitly given the compiler thinks it is length 0,
even though it is the same length as the previous instance.

Seen with 4.7.1 built from source.


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

end of thread, other threads:[~2013-04-26 22:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-15 14:35 [Bug fortran/53685] New: surprising warns about transfer with explicit character range ajmay81 at googlemail dot com
2012-06-15 16:18 ` [Bug fortran/53685] " burnus at gcc dot gnu.org
2012-06-15 17:02 ` burnus at gcc dot gnu.org
2012-06-16 10:51 ` burnus at gcc dot gnu.org
2012-06-17 19:31 ` burnus at gcc dot gnu.org
2012-06-22 10:28 ` burnus at gcc dot gnu.org
2012-09-24 13:58 ` ajmay81 at googlemail dot com
2012-11-29 10:52 ` kloedej at knmi dot nl
2013-04-22 19:23 ` janus at gcc dot gnu.org
2013-04-26 22:50 ` janus at gcc dot gnu.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).