public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55855] New: incorrect warning with type-bound procedure pointer
@ 2013-01-03  7:29 abensonca at gmail dot com
  2013-01-03  9:15 ` [Bug fortran/55855] [OOP] incorrect warning with type-bound procedure on pointer-valued base object janus at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: abensonca at gmail dot com @ 2013-01-03  7:29 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55855
           Summary: incorrect warning with type-bound procedure pointer
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: abensonca@gmail.com


The following:

module eventMod
  type, public :: event
     private
    procedure(eventTask ), pointer, public :: task
 end type event
  abstract interface
     logical function eventTask(self)
       import event
       class(event), intent(in) :: self
     end function eventTask
  end interface
end module eventMod
program test
  use eventMod
  implicit none
  logical :: r
  type(event), pointer :: myEvent
  allocate(myEvent)
  r=myEvent%task()
end program test

causes the following warning when compiled (with gfortran 4.8.0):

$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/abenson/Galacticus/Tools/libexec/gcc/x86_64-unknown-
linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --
prefix=/home/abenson/Galacticus/Tools --enable-languages=c,c++,fortran --
disable-multilib --with-gmp=/home/abenson/Galacticus/Tools
Thread model: posix
gcc version 4.8.0 20121219 (experimental) (GCC)

$ gfortran -o warn.exe warn.F90 -Wall
warn.F90:19.4:

  r=myEvent%task()
    1
Warning: POINTER valued function appears on right-hand side of assignment at
(1)

As far as I can tell, the code runs correctly despite this warning.

the warning is spurious as the "task" function returns a logical, not a
pointer.


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

end of thread, other threads:[~2013-01-03 20:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-03  7:29 [Bug fortran/55855] New: incorrect warning with type-bound procedure pointer abensonca at gmail dot com
2013-01-03  9:15 ` [Bug fortran/55855] [OOP] incorrect warning with type-bound procedure on pointer-valued base object janus at gcc dot gnu.org
2013-01-03  9:30 ` [Bug fortran/55855] [OOP] incorrect warning with procedure pointer component " janus at gcc dot gnu.org
2013-01-03 11:09 ` burnus at gcc dot gnu.org
2013-01-03 15:34 ` janus at gcc dot gnu.org
2013-01-03 16:11 ` mikael at gcc dot gnu.org
2013-01-03 16:15 ` janus at gcc dot gnu.org
2013-01-03 20:18 ` 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).