public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45190]  New: Compile-time error on valid code: can't convert TYPE(_gfortran_iso_c_binding_c_ptr) to TYPE(c_ptr)
@ 2010-08-05  7:51 mathewc at nag dot co dot uk
  2010-08-05 15:46 ` [Bug fortran/45190] " kargl at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mathewc at nag dot co dot uk @ 2010-08-05  7:51 UTC (permalink / raw)
  To: gcc-bugs

> gfortran --version
GNU Fortran (GCC) 4.5.1

> uname -a
Linux tiree.nag.co.uk 2.6.27.25-170.2.72.fc10.x86_64 #1 SMP Sun Jun 21 18:39:34
EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

> cat cfpointerstress.f90
MODULE NAG_J_TYPES
  USE ISO_C_BINDING, ONLY : C_PTR
  IMPLICIT NONE
  TYPE                            :: NAG_IMAGE
     INTEGER                      :: WIDTH, HEIGHT, PXFMT, NCHAN
     TYPE (C_PTR)                 :: PIXELS
  END TYPE NAG_IMAGE
END MODULE NAG_J_TYPES
program cfpointerstress
  use nag_j_types
  use iso_c_binding
  implicit none
  type(nag_image),pointer :: img
  type(C_PTR)             :: ptr
  real, pointer           :: r
  allocate(r)
  allocate(img)
  r = 12
  ptr = c_loc(img)
  write(*,*) 'C_ASSOCIATED =', C_ASSOCIATED(ptr)
  call c_f_pointer(ptr, img)
  write(*,*) 'ASSOCIATED =', associated(img)
  deallocate(r)
end program cfpointerstress

> gfortran cfpointerstress.f90
cfpointerstress.f90:19.8:

  ptr = c_loc(img)
        1
Error: Can't convert TYPE(_gfortran_iso_c_binding_c_ptr) to TYPE(c_ptr) at (1)


-- 
           Summary: Compile-time error on valid code: can't convert
                    TYPE(_gfortran_iso_c_binding_c_ptr) to TYPE(c_ptr)
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mathewc at nag dot co dot uk


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


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

end of thread, other threads:[~2010-08-05 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-05  7:51 [Bug fortran/45190] New: Compile-time error on valid code: can't convert TYPE(_gfortran_iso_c_binding_c_ptr) to TYPE(c_ptr) mathewc at nag dot co dot uk
2010-08-05 15:46 ` [Bug fortran/45190] " kargl at gcc dot gnu dot org
2010-08-05 16:03 ` dominiq at lps dot ens dot fr
2010-08-05 17:51 ` mikael 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).