IMPORT or C Binding bug?
Christopher D. Rickett
crickett@lanl.gov
Thu Jun 28 21:47:00 GMT 2007
On Thu, 28 Jun 2007, Steve Kargl wrote:
> On Thu, Jun 28, 2007 at 03:28:08PM -0600, Christopher D. Rickett wrote:
>> i don't think the problem has anything to do with C binding. for example,
>> the following simplified code behaves the same:
>>
>
> I agree with your analysis. I found PR 31154 after I posted the
> code. BTW, I posted a call for real-world codes using ICB on
> comp.lang.fortran. I've gotten a few responses so I trying to
> break your patch :-)
thanks for the testing. i'll nervously wait to see what bugs get reported
back and hope it's only a few. :-)
> One response stated:
>
> I hope gfortran implementation of ISO_C_BINDING permits the use of
> private components in a derived type with BIND(C) attribute (to my
> best knowledge g95 doesn't ).
>
> In a recent discussion, Richard Maine clarified that
>
> "a derived type with the BIND(C) attribute"
>
> 1) is allowed to be a "PRIVATE type" and/or
> 2) is allowed to be a type with "PRIVATE" components.
>
> The second one is used in the above Pthread Interface implementation
> (which makes perfect sense).
>
> I checked your testsuite codes (with a quick glance) and could not
> find anything that matches this description. Should we add a few
> more tests?
i'm pretty sure this will be allowed by gfortran -- i can't think of
anything i did to prevent it. i don't think the public/private attribute
for type components was implemented yet in gfortran when i did the bind(c)
work, so adding more tests now would probably be good.
Chris
More information about the Fortran
mailing list