public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mathewc at nag dot co dot uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/45190]  New: Compile-time error on valid code: can't convert TYPE(_gfortran_iso_c_binding_c_ptr) to TYPE(c_ptr)
Date: Thu, 05 Aug 2010 07:51:00 -0000	[thread overview]
Message-ID: <bug-45190-12935@http.gcc.gnu.org/bugzilla/> (raw)

> 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


             reply	other threads:[~2010-08-05  7:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05  7:51 mathewc at nag dot co dot uk [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-45190-12935@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).