This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/55855] New: incorrect warning with type-bound procedure pointer
- From: "abensonca at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Jan 2013 07:28:59 +0000
- Subject: [Bug fortran/55855] New: incorrect warning with type-bound procedure pointer
- Auto-submitted: auto-generated
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.