From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30190 invoked by alias); 18 Mar 2008 01:23:45 -0000 Received: (qmail 29939 invoked by alias); 18 Mar 2008 01:22:58 -0000 Date: Tue, 18 Mar 2008 01:23:00 -0000 Message-ID: <20080318012258.29938.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/35612] testsuite ISO_C_BIND code error In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "danp57 at optonline dot net" 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: 2008-03/txt/msg01459.txt.bz2 ------- Comment #3 from danp57 at optonline dot net 2008-03-18 01:22 ------- Subject: Re: testsuite ISO_C_BIND code error FPTR finally should POINT at that string (same thing CSTR points at) with the correct type info/structure/array-shape set up correctly. My primary reason to send this in is that these test code provides great source code examples to figure out how this stuff SHOULD work... in this case, I found myself taking on the role of debugger when I wasn't quite sure how it was supposed to work in the first place. I just figured it would help out... Dan On Mar 17, 2008, at 7:37 PM, burnus at gcc dot gnu dot org wrote: > > > ------- Comment #2 from burnus at gcc dot gnu dot org 2008-03-17 > 23:37 ------- >> The line: >> TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address >> should be:C_F_STRING(CPTR) >> TYPE(C_PTR), VALUE, TARGET:: CPTR ! the C address > > You are right. The call to strlen is OK in either case, however, > the call to > C_F_POINTER() does not make sense for a pointer to a C string > ("**char") only > for the version with VALUE ("*char") as fptr should finally contain > the string. > > > -- > > burnus at gcc dot gnu dot org changed: > > What |Removed |Added > ---------------------------------------------------------------------- > ------ > Status|UNCONFIRMED |NEW > Ever Confirmed|0 |1 > Last reconfirmed|0000-00-00 00:00:00 |2008-03-17 23:37:32 > date| | > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35612 > > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35612