[Bug fortran/49111] Unnecessary warning for private interfaces having the BIND(C) attribute

craig.powers at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Oct 12 20:54:00 GMT 2012


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

Craig Powers <craig.powers at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |craig.powers at gmail dot
                   |                            |com

--- Comment #3 from Craig Powers <craig.powers at gmail dot com> 2012-10-12 20:53:53 UTC ---
I see the accessibility denoted by PRIVATE/PUBLIC as conceptually different
from the accessibility denoted by BIND(C).  In addition to the fact that
BIND(C) does not distinguish an import from an export, there is also the
consideration that one might wish to hide the C-callable routine (marked with
BIND(C)) from other Fortran code by also marking it PRIVATE.

I'm in the process of producing a Fortran interface to a C library, and I find
that there are some instances where I want to declare the import as PRIVATE and
then provide a wrapper routine to take care of the Fortran-to-C stuff that is
mechanical e.g. converting a Fortran array.

Because my Fortran is a little rusty, and this is my first time making any
extended use of the BIND(C) features, the warning made me concerned that I
hadn't accomplished what I intended to accomplish.

I see this warning as far more likely to be a spurious complaint about valid
and intended usage than to be a useful hint about something unintended.



More information about the Gcc-bugs mailing list