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

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 
2012-05-24 18:44:54 UTC ---
On Thu, May 24, 2012 at 05:57:26PM +0000, sgk at troutmask dot
apl.washington.edu wrote:
> 
> This patch allows the code to compile.  I haven't
> tried to construct a longer example that may show
> that the module name  may collide with the C binding
> name.
> 

I've now constructed a simple test and needed to
revise the patch.

troutmask:sgk[263] cat a.f90
module exports

   implicit none

   contains

      subroutine f_exports() bind(C, name='exports')
         print *, 'Exported'
      end subroutine

end module exports
troutmask:sgk[264]  cat e.c
#include <stdio.h>

void exports(void);

int
main(void)
{
  exports();
  return 0;
}
troutmask:sgk[265] gfc4x -c a.f90
troutmask:sgk[266] cc -o z e.c a.o -L$HOME/work/4x/lib -lgfortran
troutmask:sgk[267] ./z
 Exported

The patch is attached.

Reply via email to