From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17599 invoked by alias); 3 Jan 2013 07:29:24 -0000 Received: (qmail 17561 invoked by uid 48); 3 Jan 2013 07:29:00 -0000 From: "abensonca at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55855] New: incorrect warning with type-bound procedure pointer Date: Thu, 03 Jan 2013 07:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: abensonca at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00139.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55855 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 =C2=A0 type, public :: event =C2=A0 =C2=A0 =C2=A0private =C2=A0 =C2=A0 procedure(eventTask ), pointer, public :: task =C2=A0end type event =C2=A0 abstract interface =C2=A0 =C2=A0 =C2=A0logical function eventTask(self) =C2=A0 =C2=A0 =C2=A0 =C2=A0import event =C2=A0 =C2=A0 =C2=A0 =C2=A0class(event), intent(in) :: self =C2=A0 =C2=A0 =C2=A0end function eventTask =C2=A0 end interface end module eventMod program test =C2=A0 use eventMod =C2=A0 implicit none =C2=A0 logical :: r =C2=A0 type(event), pointer :: myEvent =C2=A0 allocate(myEvent) =C2=A0 r=3DmyEvent%task() end program test causes the following warning when compiled (with gfortran 4.8.0): $ gfortran -v Using built-in specs. COLLECT_GCC=3Dgfortran COLLECT_LTO_WRAPPER=3D/home/abenson/Galacticus/Tools/libexec/gcc/x86_64-unk= nown- linux-gnu/4.8.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure -- prefix=3D/home/abenson/Galacticus/Tools --enable-languages=3Dc,c++,fortran = -- disable-multilib --with-gmp=3D/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: =C2=A0 r=3DmyEvent%task() =C2=A0 =C2=A0 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.