Bug 35613 - testsuite ISO_C_BIND code error
Summary: testsuite ISO_C_BIND code error
Status: RESOLVED DUPLICATE of bug 35612
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-17 04:06 UTC by Daniel E. Platt
Modified: 2008-03-17 16:00 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel E. Platt 2008-03-17 04:06:49 UTC
bind_c_usage_8.f03 in gcc/testsuite/gfortran.dg contains:

! PR fortran/32797
!
MODULE ISO_C_UTILITIES
   USE ISO_C_BINDING
   implicit none
   CHARACTER(C_CHAR), DIMENSION(1), SAVE, TARGET, PRIVATE :: dummy_string="?"
CONTAINS
   FUNCTION C_F_STRING(CPTR) RESULT(FPTR)
     use, intrinsic :: iso_c_binding
      TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address
      CHARACTER(KIND=C_CHAR), DIMENSION(:), POINTER :: FPTR
      INTERFACE
         FUNCTION strlen(string) RESULT(len) BIND(C,NAME="strlen") ! { dg-warning "Implicitly declared" }
            USE ISO_C_BINDING
            TYPE(C_PTR), VALUE :: string ! A C pointer
         END FUNCTION
      END INTERFACE
      CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR, SHAPE=[strlen(CPTR)])
   END FUNCTION
END MODULE ISO_C_UTILITIES
! { dg-final { cleanup-modules "iso_c_utilities" } }

The line:

TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address

should be:

TYPE(C_PTR), VALUE, TARGET:: CPTR ! the C address
Comment 1 Toon Moene 2008-03-17 16:00:21 UTC

*** This bug has been marked as a duplicate of 35612 ***